nobodyinperson,
@nobodyinperson@fosstodon.org avatar

I think it's amazing how you can get from nothing to a fully parametric #STL of a toy screwdriver in eight lines of #Python code with #sdfCAD.

If I had tried the same in a graphical #CAD software, it'd probably taken me ages. Also, none of the buttery smooth curves the #sdf - based approach makes so easy.

(Code is in the image description.)

#3dPrinting #3dDesign

chrishuck,
@chrishuck@fosstodon.org avatar

@nobodyinperson It’s cool that you can do it in code, but you could probably achieve it with 3 features in #freecad, and it would be just as parametric.

mcdanlj,
@mcdanlj@social.makerforums.info avatar

@chrishuck While I agree that it's not noticeably harder in FreeCAD than sdfCAD, I don't see how you get that same design, including the roundedness, in only three features. Here's the best I can do:

  1. Revolve base shape from profile
  2. Pocket one grip
  3. Polar pattern
  4. 3d offset (in Part WB) for roundedness
  5. Pocket shaft

Also that's either a few extra ops in Part work bench or mixing up Part Design and Part.

I agree it's not harder than SDF but I'm curious how you see it in three ops.

SDF has some really nice properties for fillets, and we know that falling fillets is something that people struggle with in FreeCAD a lot.

chrishuck,
@chrishuck@fosstodon.org avatar

@mcdanlj @nobodyinperson Ok. So, maybe four features. I'm not saying that one piece of software is better. My point is that I see so many people say that graphical CAD is so much harder, requires so much more work, or is somehow not parametric. I am trying to demonstrate that while it's very impressive that 8 lines of code can get a result, 4 features in FreeCAD can also get you there pretty easily. I tweaked dimensions(parameters) after feature creation to get a shape closer to the original.

chrishuck,
@chrishuck@fosstodon.org avatar

@mcdanlj @nobodyinperson It took me longer to write these toots than it did to create the model.

mcdanlj,
@mcdanlj@social.makerforums.info avatar

@chrishuck @nobodyinperson I guess I didn't think of just applying one fillet across the whole part like that! Thanks!

And yes, definitely agree — thinking that "graphical" means "not parametric" is false dichotomy.

I spent years doing basically everything in OpenSCAD because my first attempts to use FreeCAD were around 0.13, I think, and it was harder to use and tutorials were scarce. It's more robust now, easier to get started, and many (though for sure not all!) operations are parametric.

nobodyinperson,
@nobodyinperson@fosstodon.org avatar

@mcdanlj @chrishuck @nobodyinperson Well done! I'm well aware that graphical CAD can be parametric and the reference to the duration was more a confession of my inability to operate graphical CAD. 😅

I guess one is much more enthusiastic about a project oneself contributes to and understands deeply (I forked and maintain sdfCAD), so a little bragging might occur 😉

chrishuck,
@chrishuck@fosstodon.org avatar

@nobodyinperson @mcdanlj @nobodyinperson Totally fair! You should brag about that because it’s impressive.

I will fully admit that it took a certain explanation to get the whole Sketch->Feature workflow to click in my head when I first started with it in 1999. It feels like second nature to me. While I can certainly do programming when necessary, I often find myself referencing the docs a LOT. 😂

mcdanlj,
@mcdanlj@social.makerforums.info avatar

@nobodyinperson Are you familiar with the Manifold kernel? https://manifoldcad.org/

They have python bindings, including the ability to use SDFs. I haven't played with that myself yet, but I see it in the doc strings...☺ Manifold always produces manifold models (thus the name) and it's wicked fast. Using it as the underlying kernel in the development version of OpenSCAD has made multiple orders of magnitude speed difference in many cases.

gyroid() in the following example code is an SDF:

https://github.com/elalish/manifold/blob/master/bindings/python/examples/gyroid_module.py

Since I saw that your relatively simple model took almost two seconds to render, you might be interested in whether you could use Manifold within (your fork of) sdfCAD?

ianp5a,
@ianp5a@vivaldi.net avatar

@chrishuck @mcdanlj @nobodyinperson
This discussion is really about modelling and not design. Computers can Aid our Design by showing us the result, so we can make design decisions as we go along. If you already have an exact design in mind, you just need to model that.
'Interactive' CAD really benefits the design part. Especially for really complex models. Where 'on canvas', live, visual manipulation speeds up decisions, helps learning, and avoids "trial-and-error" loops that cost us time.
It is also useful, as designers tend to be more visual people, and less "IT" thinkers. Needing to see and touch what they are doing.
Script based CAD will suit the more IT/text thinking type of person. Often wanting a "hands-off" approach, as in this case.
I deal with all types of users. And both scripted, and interactive, styles have their places.
FreeCAD is not the best example of interactive CAD though. Tending to remote interaction via the edit panels rather than direct, on-canvas 3D manipulators. But I'm sure that will come in time.

chrishuck,
@chrishuck@fosstodon.org avatar

@ianp5a @mcdanlj @nobodyinperson I totally agree that each style has its place because I do use both. I will agree that some commercial CAD software makes editing models a little more direct than FreeCAD, but the functionality is still there. Often, commercial CAD and FreeCAD are exactly the same, and all too often I see on here people claiming that it's not. That's what grinds my gears.

nobodyinperson,
@nobodyinperson@fosstodon.org avatar

Also, while in the few hours I used graphical #CAD software (#FreeCAD, #SolveSpace) I encountered numerous situations where an operation would just straight-down not work for no apparent reason (error messages, broken geometry, weird surfaces all over the place, even segfaults), I have yet to run into one in #sdfCAD. Under the hood, it's just a scalar field in 3d space. Made by math. The marching cubes (or potentiall other algorithms in the future) turns this into a rock-solid triangle mesh. 💪

nobodyinperson,
@nobodyinperson@fosstodon.org avatar

Furthermore, you can make infinitely long or infinitely repeating objects. This is enormously convenient to cut out stuff. You do not have to think about how far to cut. No need to cut a bit deeper to avoid rendering weirdness (looking at you #OpenSCAD and #SolveSpace). Want your model to start at z=0 and cut away everything below? Intersect your design with a plane(UP) or slab(z0=0), done.

And every operation can be smoothed with a resulting edge radius: mycube - mycylinder.k(5)

nobodyinperson,
@nobodyinperson@fosstodon.org avatar

Another incredibly useful byproduct of SDF-based geometry is that 3D inset/offset operations are easy as pie: myobject.dilate(5) makes an object that's 5mm thickner. Super helpful to add clearances to holes and threads et al.

In fact, dilation is actually the simplest operation in SDF space, as objects are defined by their surface distance. So it's just addition of a fixed value.

In #OpenSCAD, making a 3D object thicker is possible (but slow) with minkowsky, thinning is not possible.

Ciantic,
@Ciantic@twit.social avatar

@nobodyinperson yeah SDFs area great for simple solid modeling like CAD, I had planned to do one in Rust WASM+Typescript. I converted one Go example to TypeScript but it was too slow, when I have time I plan to try Rust WASM for marching cubes, and see if it's faster.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines