Programmatic CAD, OpenSCAD alternatives

There are quite a few programatic CAD, OpenSCAD alternatives out there. I am collecting a list of them and providing links to them here. The requirements to be included in this list are:

  • Free and libre.
  • They are a programming language as opposed to a GUI.

OpenSCAD: The most well known programmatic CAD program. Probably the original open source one that I am aware of.openscad screenshot
CoffeeSCad: Solid CAD modeling in your browser, with a CoffeeScript based syntax (and lots more!)coffeescad screenshot showing code edit window and a rendered cube
ImplicitCAD: Powerful, Open-Source, Programmatic CAD. Haskell and extopenscad.edit area and rendered object in ImplicitCad
RapCAD: Rapid prototyping CAD IDE for RepRap and RepStrap 3D printing machines.code edit window of RapCAD with rendered line next to it
OpenJSCAD: OpenSCAD + JavaScript = OpenJSCAD, edit locally or remote online, preview in browser direct via WebGL.
screenshot of OpenJSCAD
FABFabbers bills itself as “a new site for the 3d printing community”. It provides in browser OpenSCAD compilation and linking to github projects.FABFabbers screenshot
Update: Atomic let me know about BRL-CAD, the free military-grade antecessor to all of these.
BRL-CAD mged graphics window
BRL-CAD mged command window
Update 2: gzmask pointed out SchemeCad, a programmable 3D CAD tool that supports wireframe models and features animation. Users can program Scheme Cad by writing extensions in Scheme (a dialect of LISP). It’s available for Windows and Linux.
screenshot of scheme-cad
Update 3: CScheme is the integration of geometric kernels in a functional language.
screenshot of cscheme website

;export the model
(define (print-brep shape filename)
  (BRepTools_Write shape filename))
;translate an object
(define (translate obj x y z)
  (let ((vec (make-object gp_Vec% x y z))
        (trsf (make-object gp_Trsf%)))
    (begin
      (send trsf SetTranslation vec)
      (send (make-object BRepBuilderAPI_Transform% obj trsf #t) Shape))))
;make a structure from two given object
(define (structure obj1 obj2)
  (let ((compound (make-object TopoDS_Compound%))
        (builder (make-object BRep_Builder%)))
    (begin
      (send builder MakeCompound compound)
      (send builder Add compound obj1)
      (send builder Add compound obj2)
      compound)))
;make a structure from a list of object
(define (composite lis)
  (if (list? lis)
    (cond
      ((= (length lis) 0) (error "empty list"))
      ((= (length lis) 1) (car lis))
      (else (make-compound (car lis) (composite (cdr lis)))))
    (error "Not a list")))
;build a torus
(define (torus radius circle)
  (make-object BRepPrimApi_MakeTorus% radius circle))
;build a sphere
(define (sphere radius)
    (make-object BRepPrimApi_MakeSphere% radius))
;calculate the torus dimension
(define (radius z)
  (sqrt (- 1 (* z z))))
;make all torus objects
(define (torus-on-sphere the-list)
  (composite
    (map
      (lambda (z) (translate (torus (radius z) 0.05) 0.0 0.0 z))
      the-list)))
Final export operation
;export the model
(print-brep
  (structure
    (sphere 0.3)
    (torus-on-sphere (list -0.93 -0.75 -0.5 -0.25 0 0.25 0.5 0.75 +0.93)))
  "./torus.brep")

and PLaSM: a functional language for computing with geometry.

screenshot of plasm website

DEF points1 = <<0,0,0>,<0,3,4>,<0,6,3>,<0,10,0>>;
DEF points2 = <<3,0,2>,<2,2.5,5>,<3,6,5>,<4,8,2>>;
DEF points3 = <<6,0,2>,<8,3,5>,<7,6,4.5>,<6,10,2.5>>;
DEF points4 = <<10,0,0>,<11,3,4>,<11,6,3>,<10,9,0>>;
DEF dom = intervals:1:12;
MAP:(beziersurface:< points1 , points2 , points3 , points4 >):
(dom * dom);

Thanks to Kristoffer Josefsson for those two.
Update 4: Parametric Parts allows consumers to create and print 3D parts through our web-based platform. Anyone can make an idea come to life, even without technical expertise or prior 3D experience. It apparently uses  CadQuery for its backend.
CadQuery is an intuitive, easy-to-use python based language for building parametric 3D CAD models. CadQuery is for 3D CAD what jQuery is for javascript. Imagine selecting Faces of a 3d object the same way you select DOM objects with JQuery! Thanks to Monique for pointing them out.
screenshot of parametricparts website
Pierre left a comment to let me know about POV-Ray.  The Persistence of Vision Raytracer (POV-Ray) is a high-quality, Free Software tool for creating stunning three-dimensional graphics. The syntax looks very similar to OpenSCAD and C.

#include "colors.inc"
camera{
  location <4, 4, -10>
  look_at 0
  angle 36
}
light_source{ <500, 500, -1000> White }
plane{ y, -1.5
  pigment{ checker Green White }
}
union{
  box{ -1, 1 }
  sphere{ 0, 1.375 }
  pigment{ Red }
}

screenshot of povray of sphere unioned with a cube
Let me know if I’ve left any off the list?


Comments

29 responses to “Programmatic CAD, OpenSCAD alternatives”

  1. BRL-CAD is a free, military-grade antecessor to all of these.

  2. Jason Lewis Avatar
    Jason Lewis

    Thanks for the pointer Atomico. I’ll update the article to reflect it.

  3. Jason Lewis Avatar
    Jason Lewis

    Thanks gzmask, I’ve updated the article with Scheme Cad

  4. Kristoffer Josefsson Avatar
    Kristoffer Josefsson

    Since I got here by looking for esoteric functional programming approaches to computational geometry, I thought it would be worth adding these two projects:
    http://www.dia.uniroma3.it/~scorzell/cscheme/index.htm
    http://www.plasm.net/

  5. There is alo Cadquery, but it seems development has stopped. Parametricparts.com wanted to use it.
    Did anyone link any of these cad languages to the shapeways or I.materialise Api? I would love to make customizable designs and make a little bit of money on every order. I can learn these cad languages but making an app seems a lot more complicated.

  6. Jason Lewis Avatar
    Jason Lewis

    Hi Monique,
    Thanks pointing out CadQuery and parametricparts.com to me. I’ve added them to the list.
    I’m not aware of any languages that can hook in directly to shapeways or I.materialise APIs.

  7. Hi Jason,
    I bumped into another two:
    Utishaper, It is based on coffeescad. It is still very rough though, it is just a quick preview of things to come. The modeler is at http://ultishaper.youmagine.com/app and a description on http://ultishaper.youmagine.com/shapes. Erik, the developer, told me he is working hard on it but he could use some help.
    Structuresynth: http://structuresynth.sourceforge.net/ it seems you can also use this in meshlab.

  8. Pierre Avatar
    Pierre

    Pov-Ray is a programmatic modeller for describing artistic 3d images… Using it is very similar to using open scad.

  9. […] this article is of interest to you, see my other list of OpenSCAD alternatives, and my other posts about free CAD […]

  10. Bryan Lettner Avatar
    Bryan Lettner

    Before I dive in to one of the above, I’m hoping to get some advice. I’m designing 3d parametric surfaces like this one http://functions.wolfram.com/ElementaryFunctions/Cos/visualizations/11/02/imagetext/0020/text20.gif
    with 3d parametric curves winding along the surface. Along the curve, I will want to sweep a cut, with rectangular cross-section, that maintains a relationship to the local surface normal of the parametrized surface. The curves I’m working with are similar to lissajous curves. Can anybody suggest one of the programatic CAD that would be well suited to handle this? Wolfram Mathematica worked well for for the math, but CAD capabilities were limited, so I’m looking to programmatic CAD.

    1. Jason Lewis Avatar
      Jason Lewis

      Hi Bryan,
      I’m not sure which programatic cat package would be best for your situation. Is you goal to 3d print your design? What is limiting you with the cad capabilities for Mathematica? It looks as though Mathematica can export STL files directly. Maybe you could use that file within OPENScad or similar?
      https://www.wolfram.com/technology/guide/3DPrintingScanningSupport/

      1. Bryan Lettner Avatar
        Bryan Lettner

        Thanks for the reply, Jason. Yes, the goal is for 3d printing. I actually just discovered some features in Mathematica that I was unaware of, so I think I can do it all in Mathematica now 🙂

  11. Doesn’t freeCAD use python for parametric design?

  12. You can add [removed for BDS reasons] to your list: [link removed for BDS reasons]

    1. Jason Lewis Avatar
      Jason Lewis

      Thanks for the info JP. I choose not to promote anything prduced in Israel due to the Israeli treatment of Palestinians. Please read up on the BDS for more information about why you should try and avoid things produced in Israel.

  13. Sean Avatar
    Sean

    Do any of these programmatic CAD tools implement a constraint solver?

  14. Foad Avatar
    Foad

    why nobody mentioned FreeCAD python scripts?!!!

    1. Jason Avatar
      Jason

      Thanks Daniel,
      Blockscad appears to be proprietary.
      Antimony looks interesting. Thanks for the pointers.

  15. Man, This is JUST F*&King GOOD !
    Thank you. Making a copy of your article.
    Regards

  16. Patrick Renschler Avatar
    Patrick Renschler

    Do you know if any of these have native support for dimension diagrams (labeled part measurements)? I found two libraries for openscad, but they are far from fully automated solutions.
    http://cannymachines.com/entries/9/openscad_dimensioned_drawings
    https://www.thingiverse.com/thing:280469
    I’d like to try some of the alternatives to openscad listed in your post, if any of them have that feature i’d be interested in trying them first.

    1. Jason Avatar
      Jason

      I’m not aware of any I’m afraid. Let me know what you find out Patrick

      1. I ended up going with openscad for now, and used the library that was on thingiverse. Took a little bit of time to copy/rotate/translate my design around so that I could get the necessary views, and then a little time to align the dimension bars so they were readable, but it wasn’t terrible (my design was also pretty simple).
        https://www.thingiverse.com/make:511963
        Thanks for this post!

  17. Foad Avatar
    Foad

    I also tried to list as many programing languages/APIs here:
    https://github.com/openscad/openscad/issues/2299

  18. You missed our cloud service DynaMaker for building and publishing parametric CAD with typescript: http://www.dynamaker.com

    1. Jason Avatar
      Jason

      This is a list of free and libre options.
      thanks

    2. Ok, thx for the reply. I thought that having a free community version would be enough. But its not open source unfortunately.

Leave a Reply

Your email address will not be published. Required fields are marked *