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

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 56

  • @MostlyBuilds
    @MostlyBuilds  Рік тому +26

    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 Рік тому +12

    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  Рік тому +3

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

  • @JohnPatersonAu
    @JohnPatersonAu 11 місяців тому +5

    Great vid! You are a natural teacher. 👍👍

    • @MostlyBuilds
      @MostlyBuilds  11 місяців тому +1

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

  • @FilamentFriday
    @FilamentFriday 5 місяців тому +3

    This was great. Explained well and easy to follow. Thanks.

  • @JAYTHEGREAT355
    @JAYTHEGREAT355 7 місяців тому +3

    amazing work. i use solid works and matlab with tool packs , this scad is like learning to walk again.

  • @JosephSaintClair
    @JosephSaintClair 18 днів тому

    Brilliant video. Extremely followable and reproducible.
    Well done 👏🙏

  • @davidrgilson
    @davidrgilson Рік тому +2

    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  Рік тому +1

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

    • @davidrgilson
      @davidrgilson Рік тому

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

    • @MostlyBuilds
      @MostlyBuilds  Рік тому +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 Рік тому

      @@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 Рік тому

      @@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!

  • @jeremyjedynak
    @jeremyjedynak 7 місяців тому +1

    Great starting tutorial in less than ten minutes!

    • @MostlyBuilds
      @MostlyBuilds  7 місяців тому +1

      Thanks! Maybe I need a more catchy title. OpenSCAD in less than 10 minutes, or your money back!

  • @GottfriedLeibniz5
    @GottfriedLeibniz5 16 днів тому

    Can it be used for construction purpose?

  • @fastbike9845
    @fastbike9845 Рік тому +1

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

    • @MostlyBuilds
      @MostlyBuilds  Рік тому +2

      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 Рік тому +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.

  • @tensiondriven
    @tensiondriven 11 місяців тому +1

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

    • @MostlyBuilds
      @MostlyBuilds  11 місяців тому

      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?

    • @ludwig2345
      @ludwig2345 2 місяці тому

      I use PowerShell a lot at work so I'm very used to piping stuff around a bunch so a pipe operator would be pretty cool.

  • @banalestorchid5814
    @banalestorchid5814 Рік тому +3

    That was awesome, thanks for that!

    • @MostlyBuilds
      @MostlyBuilds  Рік тому

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

    • @banalestorchid5814
      @banalestorchid5814 Рік тому

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

  • @shakejones
    @shakejones Рік тому +2

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

    • @MostlyBuilds
      @MostlyBuilds  Рік тому +1

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

    • @shakejones
      @shakejones Рік тому

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

  • @Mike-lu1pt
    @Mike-lu1pt Рік тому +11

    so much work for such a simple shape

    • @The-KP
      @The-KP 11 місяців тому +4

      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 11 місяців тому

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

    • @qta4425
      @qta4425 8 місяців тому +3

      @@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.

  • @im.empimp
    @im.empimp 7 місяців тому +5

    The `#` and `!` tips 🤯!

    • @MostlyBuilds
      @MostlyBuilds  7 місяців тому +1

      Haha awesome right? I was really hoping for a comment about this when I was making the video! You made my day 🎉

  • @volodymyrh1413
    @volodymyrh1413 2 місяці тому +1

    Very informative

  • @americancolor2
    @americancolor2 Рік тому

    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  Рік тому

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

  • @neilburrows6670
    @neilburrows6670 2 місяці тому +1

    Superb

  • @Vermilicious
    @Vermilicious 8 місяців тому +2

    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  8 місяців тому +1

      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.

    • @pixelfrenzy
      @pixelfrenzy 4 місяці тому

      JSCAD (formerly OpenJSCAD) is a JavaScript-based equivalent if that would feel more comfortable. There's also SolidPython which is a python front-end that compiles to OpenSCAD code.

  • @demias1000
    @demias1000 28 днів тому

    Nice one

  • @Kilakro
    @Kilakro Рік тому +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  Рік тому +2

      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 Рік тому +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 Рік тому

      @@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  Рік тому +1

      @@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 Рік тому +2

      @@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.

  • @blunderchips
    @blunderchips 8 місяців тому +1

    great video

  • @NavyCuda
    @NavyCuda 9 місяців тому

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

    • @theJonnymac
      @theJonnymac 2 місяці тому

      i wonder if some code from blender could be brought in for that

  • @JTerry-zl5un
    @JTerry-zl5un 8 місяців тому

    Great video