OpenSCAD: The Programmer's Solid 3D CAD Modeller
161–170 of 191 posts
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#162Earlier quoted context omitted.
> Isn't that basically coding in G-code? No, I think G-code is too prescriptive and low level for the modelling task. What I'd prefer is some way to specify operations in a fluent, object-oriented API e.g.: round_bar = RoundBar( alloy=1018, diameter=Dimension(1*Inch, error=0.010*Inch), length=Dimension(12*Inches, error=0.25*Inch) ) 3_jaw = 3JawChuck(tolerance=0.005) between_centers = BetweenCenters() center_drill = C…
I can see where you are coming from, and I've thought about similar ideas. But ultimately, I think this fails for separation-of-concern reasons. Describing the part is different from describing how to make the part. The same part might be sent to 3D printing for a non-functional fit prototype, sent to a prototyping machine shop to make 5 or so units on basic CNC machines that require 3 set-ups to complete it, and aft…
I think you might have a point here, but I'm going to push back on the idea that these three parts are the "same part" because they'll all have wildly different mechanical properties, dimensions, and dimensional consistency. They are not all necessarily interchangeable (although they could be, we'd have to integration-test them in an assembly to find out!).
My point is the "abstract part" isn't really a thing, and the real life characteristics of each concrete part are inextricable from the way it's made and what it's made of. I wonder if it would be helpful to force me, the designer, to think about it that way from the start?
3D printing is an odd case that tbh I hadn't really thought of. The things I make are all subtractively manufactured (except for welds which are addictive only in a degenerate sense), and I have no experience with 3D printing.
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#163Earlier quoted context omitted.
To be fair this is my attempt in build123d. r1, r2 = 55/2, 30/2 cd = 125 # construct rib profile, start with slope and oversized arc # reposition line to be constrained on arc center height and Y axis l = build_line(O, op_line(-8, 30, name='l1'), op_arc(30, -90, name='a1')) l.move(Vector(77-r1*2, 0) - l.a1.center_point) ip, = intersections(l.l1, Axis.Y) l.move(Y(50 - ip.Y)) # Now we know first arc center and could pr…
This was my impression with build123d and Cadquery. On paper they have a better abstraction than OpenScad. Yet, the code to express the same output is more bloated. I was never able to get over the yak shaving learning curve to be proficient. Openscad mental model is a lot simpler to sustain momentum to go build something. How did you get around to prefer Cadquery/build123d?
But it's trivially ready to be parameterized and reused. Model is easy to change, you could think about relations between features not absolute entities.
It's my 3rd attempt to use code-CAD to be honest. OpenSCAD -> CadQuery -> Build123d. I have past experience with SolveSpace and OnShape. GUI CAD approach with drafting in 2D and making solids as late as possible works perfectly well and you could transfer spatial thinking as-is to model coding.
I have somewhat frustrating experience with OpenSCAD and CadQuery. OpenSCAD is perfect for simple things but gap to complex parameterized models was to big for me. CadQuery looks great in examples, but I could not grasp how to use it for my tasks. State tracking is crazy hard.
There are three major factors it clicked for me with build123d.
First is explicit algebra mode. My little coder brain could not comprehend large object trees from OpenSCAD or hardcore chain dance of cadquery. But I know what an object and mutability are. Build123d is amazingly intuitive and has tight primitive set large enough for complex things and small enough to be memorized by heart. Also Build123d has nice docstrings and type hints. I mainly use IDE help instead of online docs.
Second is a good interactive visualizer. I use yet-another-cad-viewer[1]. It allows to quickly debug issues and use my favorite editor. It's crucial to have visual representation and ability to know object bindings to variable name in source code. Killer features for me are on-hand access to per-object transparency setting and selection tool to measure distances between features. It really helps during learning.
Third is I actually sat down and spent around 10h with TTT practice models[2] :))
I believe I'm already effective with Build123d on the same level as with OnShape.
There is a major weak thing with code-CADs though. It's edge selection for fillets. I think about custom filters to narrow edge location. But now it's largely a guess work with edge visualization on fail.
[1]: https://github.com/yeicor-3d/yet-another-cad-viewer [2]: https://www.tootalltoby.com/practice/
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#164Earlier quoted context omitted.
I find it quite surprising that you're a self-proclaimed greenhorn, but very opinionated about what apps people should be using.
It is a reasonable point. I am a greenhorn in the sense that I've been learning CAD for my own somewhat complex, multi-part projects for three years. And I am not an industrial designer. Or a mathematician! (I am opinionated.) The point for me is that, as a relative novice, I have got past some really important hurdles recently. So I can explain the benefits of getting past them to people who maybe don't know they ar…
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#165Discovering OpenSCAD via its official tutorial: > On the example above, the second cube sits exactly on top of the first cube. This is something that should be avoided as it’s not clear to OpenSCAD whether the two cubes form one object together. This issue can be easily solved by always maintaining a small overlap of about 0.001 - 0.002 between the corresponding objects. This goes against the whole point of doing par…
Wrong. Objects can overlap in computational geometry.
I am referring to the specific case of the tutorial, where second box is exactly on top of first box. By design, there is no overlap and there is no gap, just a continuum of solid.
However, such continuum of solid can't be declared with exact coordinates in OpenSCAD, and instead one has to add intentional error to coordinates so that the solids overlap and the continuity is guaranteed.
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#166Earlier quoted context omitted.
Not as-of-yet --- it's 3-axis at the moment --- hoping to eventually add support for additional axis/axes. Have you looked at grblgru.com ? Not opensource, but does have CNC lathe support.
It's not a serious problem I have, just saying I like OpenSCAD, I have been able to generate every shape I've ever needed to create, and it would do everything I want if it was possible to generate true curves (because I farm out the manufacturing).
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#167I don't say it's impossible but I believe it's quite near to impossible for most of OpenSCAD users to model this relatively simple drawing[1]. It's a breeze in CAD with constraint solver. Also it's viable in code-first systems with access to shape coordinates (build123d) using only construction geometry and projections. OpenSCAD requires hard trigonometry and math skills to pull it out. OpenSCAD has amazing community…
13 minutes. And I am very much at the lower end of the CAD skill scale $fn=100; difference(){ union(){ cylinder(d=55,h=60); translate([125,0,0]) cylinder(d=30,h=32); linear_extrude(11) polygon([[0,25],[125,15],[125,-15],[0,-25]]); translate([0,5.5,0]) rotate([90,0,0]) linear_extrude(11) polygon([[0,50],[125,40],[125,0],[0,0]]); } cylinder(d=35,h=70); translate([125,0,0]) cylinder(d=20,h=40); translate([110,8,98]) rot…
https://www.blockscad3d.com/community/projects/1814083
which is mostly parametric --- only the placement of the rounding of the last radius is hard-coded/fudged.
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#168If you want to do code-CAD for anything substantial and you haven't yet developed a significant dependency on OpenSCAD, do your brain a favour and spend at least some time with CadQuery, Build123D or (if you prefer JS to Python) Replicad. As impressive as NopSCADlib and BOSL2 are (and OMG they are, when you consider what they have to work with!) , OpenSCAD is a one-way, declarative CSG environment that essentially on…
As I suspected, none of the 3 tools you mentioned are in Ubuntu repository.
(N.B. the Replicad studio code editor on that site seems to be broken today, which is a bummer -- it wasn't when I last checked)
CadQuery might not be in Ubuntu repositories on its own (same with Build123D -- these are python libraries really) but have you tried looking for cq-editor? (I think that's in Homebrew as well.)
https://snapcraft.io/install/cadquery-editor/ubuntu
To be fair I'd probably install the VSCode support for Build123D and CadQuery instead, because 1) this is code-CAD and you really manage it as such, and 2) I'm not that fond of the cq-editor environment.
https://marketplace.visualstudio.com/items?itemName=bernhard...
https://github.com/bernhard-42/vscode-ocp-cad-viewer
This extension can install Build123D or CadQuery for you if you have a python setup for VSCode.
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#169Earlier quoted context omitted.
This was my impression with build123d and Cadquery. On paper they have a better abstraction than OpenScad. Yet, the code to express the same output is more bloated. I was never able to get over the yak shaving learning curve to be proficient. Openscad mental model is a lot simpler to sustain momentum to go build something. How did you get around to prefer Cadquery/build123d?
> Yet, the code to express the same output is more bloated. But it's trivially ready to be parameterized and reused. Model is easy to change, you could think about relations between features not absolute entities. It's my 3rd attempt to use code-CAD to be honest. OpenSCAD -> CadQuery -> Build123d. I have past experience with SolveSpace and OnShape. GUI CAD approach with drafting in 2D and making solids as late as pos…
I was able to check that box with PythonSCAD thus far, so that's "solved" for me.
Otherwise, I see a lot of vector/coordinate manipulation that isn't too different from OpenSCAD/PythonSCAD.
However, I can see there's some additional abstraction primitives with arc and tangents that looks nice. That doesn't quite exist in any OpenSCAD based or similar engine since there's no built-in way to get info out of the shapes in a reflection-like way.
Maybe I will give Build123d another go and see if I can sustain some sort of momentum.
Re: OpenSCAD: The Programmer's Solid 3D CAD Modeller
#170Earlier quoted context omitted.
It is a reasonable point. I am a greenhorn in the sense that I've been learning CAD for my own somewhat complex, multi-part projects for three years. And I am not an industrial designer. Or a mathematician! (I am opinionated.) The point for me is that, as a relative novice, I have got past some really important hurdles recently. So I can explain the benefits of getting past them to people who maybe don't know they ar…
This is not true anymore with PythonSCAD. There is a mesh() function which can yield the points and triangles from any Object. The User is free to modify these points and faces and finally create a new solid from it "polyhedron" You could use this to skew your model in a fancy way by altering the point coordinates but it might be more difficult to alter on the triangles.
Say for example a single six-sided die: six faces, twelve edges.
But this would be twelve mesh triangles, right? None of which individually represent a face -- and six of the mesh edges are not edges in the true geometry.
A rounded six-sided die might have 26 faces (including the curved edges, rounded corners). 48 edges between them. etc. But the number of mesh triangles and edges will vary according to the precision.
bRep kernels can give you the geometry information, not just the mesh information.