HN Simulatornew | past | comments | lists | submit | jeffbarr's commentslogin

I have found that a combination of the two approaches works best for me. In some cases it is easiest and most practical to combine (union) shapes to get to what you want, and in others it easiest to subtract (difference or intersect).


But then you won't be able to bevel complex shapes at all, which means that you won't be able to describe the object that you will end up with. "Good" CAD means that the representation in the computer is as close to the object you want to produce as you can make it. This makes it possible for downstream systems to accurately select nozzles and toolheads to get you what you want. If you produce an impossible object then your slicer or path computer will give you an approximation. That can be fine in some cases but usually your objects need to mate and if you mate two approximations you'll find quickly that that does not really work.


Most hobbyist are using CAD for 3D printing and not for CNC


There are more low-cost 3D printers than inexpensive CNC machines, so that's a given.

That said, it's pretty easy to just output an STL from OpenSCAD, open it in a 3D CAM tool (Kiri:Moto is a free option, MeshCAM (ob. discl., I work for a distributor) paid) and get toolpaths.

Folks have worked up various other approaches --- I've been using PythonSCAD to output a DXF which can then be used for making toolpaths:

https://github.com/WillAdams/gcodepreview


I have been using OpenSCAD to create cool geometric designs for 3D printing on fabric, with great results. The functional model is likely unfamiliar to most developers, but I have found that I can be efficient and productive with it.

Check out my repos of OpenSCAD objects at https://github.com/jeffbarr/OpenSCADObjects and Truchet Tilings at https://github.com/jeffbarr/TruchetTilings .

My code kind of looks like the C that I wrote in the 1980s, with lots of braces and careful indenting -- not sure if that is a bug or a feature.

As another commenter noted, use the latest nightly build for best results.


Why not switch to CadQuery or build123d?


I cloned the repo and used a local model (Qwen 3.8 27B) on my 5090 and was able to mechanically translate most, but not all, of the OpenSCAD to cadquery, and verified that a few had sensible output (next I will work on the tilings, I'm a tiling nerd).

As an example, the dentist's square code looks quite reasonable to me (I'm a python programmer by choice):

    """
    dentist_square.py
    =================
    CADQuery port of ``dentist_square.scad`` -- a "quad from the dentist's office":
    four small hollow squares in a 2x2 grid plus one larger hollow square in the
    centre, each with a thin rim on top.
    """

    import os
    import sys

    sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
    import cq_common as C

    # ---------------------------------------------------------------------------
    # Parameters (from dentist_square.scad)
    # ---------------------------------------------------------------------------
    _EDGE_WIDTH = 3.5
    _SMALL_SQUARE_WD = 18.5
    _SMALL_SQUARE_H = 2
    _BIG_SQUARE_WD = 28.5
    _BIG_SQUARE_H = 2.6
    _SMALL_SQUARE_SPACE = 22.5
    _RIM_WIDTH = 0.4


    def hollow_square(wd, h, edge_width):
        """A hollow square: a ``wd x wd`` box with a centred hole of
        ``wd - 2*edge_width``."""
        outer = C.cube(wd, wd, h, centered=False)
        inner = C.cube(wd - 2 * edge_width, wd - 2 * edge_width, h + 0.01, centered=False)
        inner = C.translate(inner, (edge_width, edge_width, 0.0))
        return C.difference(outer, inner)


    def hollow_square_with_rim(wd, h, edge_width, rim_width):
        """A hollow square with a thin rim (a second, thinner hollow square) on top."""
        base = hollow_square(wd, h, edge_width)
        rim = C.translate(hollow_square(wd, 0.2, rim_width), (0, 0, h))
        return C.union(base, rim)


    def four_hollow_squares(wd, h, space, edge_width, rim_width):
        shapes = []
        for x in range(2):
            for y in range(2):
                sq = hollow_square_with_rim(wd, h, edge_width, rim_width)
                shapes.append(C.translate(sq, (x * space, y * space, 0.0)))
        return C.union(*shapes)


    def five_square(small_wd, big_wd, small_h, big_h, space, edge_width, rim_width):
        center = (space + small_wd) / 2.0
        four = four_hollow_squares(small_wd, small_h, space, edge_width, rim_width)
        big = C.translate(
            hollow_square_with_rim(big_wd, big_h, edge_width, rim_width),
            (center - big_wd / 2.0, center - big_wd / 2.0, 0.0),
        )
        return C.union(four, big)


    def main():
        return five_square(
            _SMALL_SQUARE_WD, _BIG_SQUARE_WD, _SMALL_SQUARE_H, _BIG_SQUARE_H,
            _SMALL_SQUARE_SPACE, _EDGE_WIDTH, _RIM_WIDTH,
        )


    if __name__ == "__main__":
        shape = main()
        out_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "stl")
        os.makedirs(out_dir, exist_ok=True)
        path = os.path.join(out_dir, "dentist_square.stl")
        C.export_stl(shape, path)
        print(f"Exported {path} (volume {shape.Volume():.2f} mm^3)")



Oh, I assumed that "style guide" meant things like starting launch posts with "I'm excited to announce", providing a simple demonstration of how to use the service, including screenshots, including a customer quote if available, and ensuring that pricing and availability were clearly laid out.


There are, internally, and theyre pretty good. I always tried to use the AWS Docs style guide when writing internally, for example. Theyre specific on how to refer to products vs services vs features, which nouns to use, tone, grammar, etc.

PS: you might get tripped up on 0x00, 0x2F, or similar control characters? As i recall any valid octet can be included in a label. We definitely saw literal ‘*’ and ‘.’ inside labels. And I wouldnt be surprised to find a bell in there either.


Guidelines | FAQ | Lists | API | Security | DMCA | Apply to YC | Contact

Search: