3D Modeling with Code! The best demo (OpenSCAD)

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ค. 2024
  • This is a great intro to the code-based 3D modeling CAD software called OpenSCAD. If you are a coder or just good at math, you can 3D model like a pro with an easy and intuitive interface that requires virtually no learning of complex UX paradigms. Best of all it is free and open source!
    This video walks through creating a 3D model for an adapter to support a patio umbrella inside an aluminum square tube leg on a boat dock. I printed this part using PETG filament on my Creality CR10s 3D printer.
    Links (some are affiliate links)
    - Source code & files: www.thingiverse.com/thing:618...
    - OpenSCAD download: openscad.org/downloads.html
    - OpenSCAD cheat sheet: openscad.org/cheatsheet
    - Hatchbox PETG (Orange): amzn.to/3OPNV05
    ----
    The MostlyBuilds channel is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.
  • แนวปฏิบัติและการใช้ชีวิต

ความคิดเห็น • 44

  • @MostlyBuilds
    @MostlyBuilds  7 หลายเดือนก่อน +12

    FYI, use union() instead of group(). It was brought to my attention that group() is an older API that likely just aliases union().

  • @JernD
    @JernD 9 หลายเดือนก่อน +8

    Nice video! I reimplemented it in build123d (a different type of CodeCAD that uses python and has built-in functions like fillet/chamfer). Here is the source code in build123d:
    from build123d import *
    with BuildPart() as p:
    with BuildSketch() as s:
    RectangleRounded(43.25,43.25,5)
    extrude(amount=-35)
    with BuildSketch() as s2:
    RectangleRounded(43.25+8,43.25+8,5)
    extrude(amount=5)
    Hole(38.5/2)

    • @MostlyBuilds
      @MostlyBuilds  9 หลายเดือนก่อน +2

      Very cool! I will definitely check out build123d! Thanks for sharing. Consider subscribing 🙂

  • @Light_Akira
    @Light_Akira 3 หลายเดือนก่อน +4

    it is so cool to be a developer!

  • @JohnPatersonAu
    @JohnPatersonAu 3 หลายเดือนก่อน +3

    Great vid! You are a natural teacher. 👍👍

    • @MostlyBuilds
      @MostlyBuilds  3 หลายเดือนก่อน +1

      Thanks! I’m planning to make more OpenSCAD videos.

  • @banalestorchid5814
    @banalestorchid5814 8 หลายเดือนก่อน +2

    That was awesome, thanks for that!

    • @MostlyBuilds
      @MostlyBuilds  8 หลายเดือนก่อน

      Thanks for the feedback! I might post more OpenSCAD videos in the future. Consider subscribing if you are interested.

    • @banalestorchid5814
      @banalestorchid5814 8 หลายเดือนก่อน

      @@MostlyBuilds I have done so already! I would be interested in more OpenSCAD videos for sure.

  • @shakejones
    @shakejones 4 หลายเดือนก่อน +2

    Great video+explanation+presentation! Well done mate - NEW SUB 🙏🏻

    • @MostlyBuilds
      @MostlyBuilds  4 หลายเดือนก่อน +1

      Thanks so much! I’m planning to do more OpenSCAD videos in the future.

    • @shakejones
      @shakejones 4 หลายเดือนก่อน

      Please do mate, even just small basic builds, you are really smooth with your presentation@@MostlyBuilds

  • @blunderchips
    @blunderchips 20 วันที่ผ่านมา +1

    great video

  • @davidrgilson
    @davidrgilson 8 หลายเดือนก่อน +1

    Scad looks great for my next project - more tutorials would ber great. Currently trying to do this kind of thing with geometry nodes in Blender.

    • @MostlyBuilds
      @MostlyBuilds  8 หลายเดือนก่อน +1

      Thanks for the feedback! I have a few ideas for future videos. Consider subscribing if that interests you 😀

    • @davidrgilson
      @davidrgilson 8 หลายเดือนก่อน

      @@MostlyBuilds Already did ☺️ My project is to design a large power bank that will be 3D printed. Lots off complicated fittings etc.

    • @MostlyBuilds
      @MostlyBuilds  8 หลายเดือนก่อน +1

      @@davidrgilson cool! If you aren’t aware of “heat set inserts,” that might be something to check out if your parts need solid screw attachment points.

    • @davidrgilson
      @davidrgilson 8 หลายเดือนก่อน

      @@MostlyBuilds I have to confess but I am aware of them but was too lazy to work with them and instead just made screw holes in the print but I could tap the screws into. Probably terrible practise

    • @davidrgilson
      @davidrgilson 8 หลายเดือนก่อน

      @@MostlyBuilds to clarify, I'm talking about the previous power bank for they designed in Blender. Maybe I'll do better with this next one!

  • @Mike-lu1pt
    @Mike-lu1pt 4 หลายเดือนก่อน +5

    so much work for such a simple shape

    • @The-KP
      @The-KP 3 หลายเดือนก่อน

      I've tried OpenSCAD, JSCAD, and FreeCAD.. FreeCAD is the winner. OpenSCAD you wind up with a piles of obtuse code. JSCAD gives you obscure errors if the slightest thing is off, making you dig thru their source code to understand why. FreeCAD, you just put your parameters, equations and constraints in a spreadsheet and the rest is traditional CAD. So easy. And if you require code to generate the object, you can interface to FreeCAD from almost any language, and generate your object.

    • @Mike-lu1pt
      @Mike-lu1pt 3 หลายเดือนก่อน

      @@The-KP Haha and I gave up on FreeCAD cuz Fusion360 was just so much more intuitive.

    • @qta4425
      @qta4425 12 วันที่ผ่านมา

      @@The-KP "and the rest is traditional cad" That can be a problem. CAD is complex and if you are new to it, the learning curve can be steep, especially with Free CAD which is known to be buggy. However, if you are already comfortable with simple programming concepts then OpenSCAD makes designing simple functional parts like this quick and easy as demonstrated in this video. Including parameters and saving portions as reusable functions makes future designs even easier. For simple functional parts like this, OpenSCAD is ideal.

  • @fastbike9845
    @fastbike9845 7 หลายเดือนก่อน +1

    Very nice, you made the process seamless.
    How would I go about adding a chamfer along the top ?

    • @MostlyBuilds
      @MostlyBuilds  7 หลายเดือนก่อน +1

      Check out this rounded cube library: danielupshaw.com/openscad-rounded-corners/
      The pink cube in the example is the one you want I think. I assumed you just want a softer edge. I came across this chamfer library as well that just chops it off at and angle, if you prefer that: github.com/hraftery/prism-chamfer
      My rounded cube implementation that just does the sides is pretty basic. Certainly possible to improve on it with what you are asking for, but probably better to leverage the work of others that have spent the time to build proper libraries for rounding.

    • @davidkaye821
      @davidkaye821 7 หลายเดือนก่อน +1

      A pretty simple way would be to place octohedra with the radius of your desired chamfer at each of the (offset inwards) corners of the "cube", then wrap everything up in a "hull". Make the octohedra with two cylinders end to end, with d2=0 and $fn=4. Just use spheres and you'll get rounded fillets from the same code, mix and match if you want.
      You can do the same sort of thing with the "minkowski" operation, if you can get your head around how it works.

  • @JTerry-zl5un
    @JTerry-zl5un 12 วันที่ผ่านมา

    Great video

  • @JonathanYankovich
    @JonathanYankovich 3 หลายเดือนก่อน

    Great video! Man, I really wish OpenSCAD had an Elixir-style "pipe" operator.

    • @MostlyBuilds
      @MostlyBuilds  3 หลายเดือนก่อน

      Thanks! You could always try contributing a change to the open source repo. The devs that run it are on IRC I believe. I chatted them a while ago about a feature I was considering building and they were cool about it. Sadly I never got around to completing it 😩
      What situations would you find it useful to pipe a result to a function or module? Just looking to eliminate intermediate variables or something?

  • @Kilakro
    @Kilakro 8 หลายเดือนก่อน +1

    I just recently learned about this software, the code reminds me of Python and isn't intimidating at all. I was worried that it would look like C or C++ being an open source project.

    • @MostlyBuilds
      @MostlyBuilds  8 หลายเดือนก่อน

      Yeah it’s pretty friendly. For a long time the IDE didn’t have autocomplete, but they added that in the past few years. It’s really nice. Between that and the “cheat sheet” that they publish, I rarely ever have to look stuff up in the official manual. openscad.org/cheatsheet/
      Thanks for checking out the video!

    • @davidkaye821
      @davidkaye821 7 หลายเดือนก่อน +2

      There are some VERY cool tricks too. Look deeply into the Customizer for starters.
      Selected text can be dragged to move it, or cntrl-dragged to copy it, nice.
      Also, and this might be the MOST useful feature of this wonderful program: Put your cursor just to the right of any digit, then ALT-UP will increase that digit and ALT-DOWN will decrease it. Updates will render instantly, and it makes fine adjustment SOOOO simple. If you need more precision, ALT-RIGHT will add decimals to the number. Brilliant.
      Lastly, since I hate to type, I created a whole bunch more of the command templates, the ones you can access by right-clicking in the Editor, and clicking Insert Template. There are a few simple ones by default, but you can make whatever you want. I often want to create a cube with both rotation and translation, so I made one template that inserts all three with default values. The templates are just .txt files with a .json extension, and the syntax is easy.
      I'm happy to help if you have any questions. :)

    • @davidkaye821
      @davidkaye821 7 หลายเดือนก่อน

      @@MostlyBuilds I have a question, if you don't mind. Does autocomplete do anything more than showing you the syntax and completing the keyword you are typing, or am I just using it wrong? It would be great to be able to insert the entire structure with default values, like Insert Template, right then and there. Thank you for your consideration, and for making this great video!

    • @MostlyBuilds
      @MostlyBuilds  7 หลายเดือนก่อน

      @@davidkaye821 my experience with the autocomplete is the same as yours. It's pretty basic, but it's so much better than before when there was nothing at all. The better solution that you described would be really nice. Other IDEs behave this way with inserting the whole code block and putting placeholder values in (Xcode for example).
      Recently I read about a VSCode plugin for OpenSCAD: github.com/Leathong/openscad-support-vscode
      I haven't used it, but it says that it supports autocomplete. Not sure how it performs. Might be worth checking out.
      Thanks for the comments and the kind words!

    • @davidkaye821
      @davidkaye821 7 หลายเดือนก่อน +1

      @@MostlyBuilds Would you be interested in seeing all the templates I've made up? My goal is to NEVER type a keyword in again. I could post them right here in these comments, it's just a page or two of text.

  • @americancolor2
    @americancolor2 4 หลายเดือนก่อน

    Hey man! I think iam doing something wrong. Can you help me to understand what iam doing wrong if i send you screenshot? Thansk à lot!

    • @MostlyBuilds
      @MostlyBuilds  4 หลายเดือนก่อน

      Sure. If you want to message me on instagram I’ll take a look: instagram.com/mostlybuilds

  • @NavySturmGewehr
    @NavySturmGewehr 2 หลายเดือนก่อน

    I really love openscad. Its biggest limitation is that it doesn't generate real arcs.

  • @Vermilicious
    @Vermilicious หลายเดือนก่อน

    OpenSCAD seems to rely on a custom language. That doesn't seem like a good decision to me. Otherwise, I found the concept intriguing.

    • @MostlyBuilds
      @MostlyBuilds  หลายเดือนก่อน

      It’s not hard to learn in my opinion. Most of your time is spent calling the SCAD functions to describe the geometry, which is basically equivalent to calling custom functions written in your language of choice. The actual language constructs that you need for control flow and looping etc are basically the same as any other language.
      I’ve heard of projects that let you write code in another language and compile to SCAD. I looked this one up after I saw your message: github.com/jeff-dh/SolidPython
      No idea how good it is, but maybe worth checking out.