Parametric 2D and 3D modeler written in pure javascript

Similar projects worth following
Parametric 2D and 3D modeler written in pure javascript. The goal is to create parametric CAD software for web.

  • Geometric Constraint Solver. This is a most crucial component which allows to solve a system of geometric constraints applied to a sketch.
  • 2D Sketcher. Allows to design 2d sketches applying geometric constraints. Uses HTML5 canvas for rendering.
  • 3D Modeller. Is used for solid modelling. Uses 2D sketches to perform EXTRUDE and CUT operations on faces of a solid object. Uses WebGL and THREE.js for rendering
  • 3D modeller supports navigation over history of modifications where parameters of the craft operations(extrude/cut) could be changed and reapplied again
  • Export to STL, DWG and SVG formats
  • Saving projects in the browser locale storage
  • Repository of dimensions. For example if there is a line length constraint applied, it's not necessary to hardcode some length value. A dimension with a symbolic name can be created and the constraint can refer to that dimension by name. Once value of dimension gets changed the sketch is resolved again accordingly to the new dimension values.
  • 2D measurement tool. Allows adding dimensions on a 2D drawing(Linear, Vertical, Horizontal and Arc/Circle dimension are supported)
  • No any server-side needed. Only client side Javascript.

  • BREP face tessellation implemented!

    Val Erastov10/12/2017 at 06:25 0 comments

    Tessellating of BREP(trimmed) surfaces is done.  Check out the example of a bounded BREP surface with a hole inside tessellated.  

  • NURBS Support

    Val Erastov10/12/2017 at 06:23 0 comments

    After getting some success with the BREP boolean algorithm next step should be  supporting all other kinds of surfaces. I decided to start with the NURBS surfaces because it is possible to represent almost any other surface like cylindrical, spherical, conical, torus and etc… by NURBS.  For NURBS evaluation a picked only available for javascript library:  Also I have compiled opennurbs (a NURBS library written in C++) to javascript. Still haven't decided which library to use. At that point, I had to implement the following in order to move on:

    1. Enhance my BREP boolean algorithm to support curves and NURBS surfaces.
    2. Trimmed by loops NURBS surface tessellation which is needed for visualization.  vernurbs is only able to tessellate un-treamed surfaces. 

  • BREP testing framework and 73 unit test for BREP boolean operations

    Val Erastov10/12/2017 at 06:21 0 comments

    After my first implementation of BREP boolean algorithm I started running into the corner cases like coincident vertices/edges/surfaces and etc. 

    It was a time to create a testing framework  for BREP sub-system to track the regressions and to test the quality of the boolean algorithm on the crazy data.

    Here is the view of my testing framework. I have creates 73 automated  tests for brep boolean so far:

    Here are some examples of the corner case. All these objects are created by applying the boolean operations on a box.

  • BREP and first approach to Boolean algorithm

    Val Erastov10/12/2017 at 06:13 0 comments

    After the implementation of the 2d sketcher I decided to come up with a proof of concept of designing things in 3d where one can:

    1. pick a face and then draw a sketch on a that face
    2. Convert the 2d sketch to 3d by either extruding or revolving it
    3. Perform a Boolean operation: either union or subtract

    My first implementation of 3D sub-system was based on csg.js library It’s a great library and allowed me to put 2d and 3d sub-systems together and come up with the first prof of concept. This library gave me the most important piece I didn't have is to perform the 3d operations on 3d objects(union,  intersect and subtract).

    CSG.js uses the mesh representation which means I had to tessellate the faces to triangles in order to perform a boolean operation loosing the information about  a face boundary such as kind of line(circle, arc, line…) and its parameters. This fact means that it's not really possible to draw a sketch applying constraints to the face boundary.

    The second big limitation of the csg approach was unable to perform any operations on edges like facets or fillet. Neither on vertices. Because all this information gets lost after the tessellation.

    Recovering the boundaries  information wasn't really possible and I hade few failed attempts to solve this problem.

    So taking into account that such implementation of 3d was a just proof of concept it was a time to move on and coming up with a better engine for the 3d part.

    The industrial standard for 3d  CADs is BREP - boundary representation. Unlike mesh-based data structures which is just a big set of triangles(or maybe convex polygons) the BREP is a collection of connected surfaces where each surface can be for example a plane or a conical surface or a NURBS. A surface is trimmed by a set of edges. A trimmed surface  is connected to other trimmed surfaces through those edges. 

    Another big advantage of BREP is that after applying boolean operation the boundary information(edges and vertices etc.) doesn't get lost. No tessellation is required for the boolean operations. Tessellation is only needed for visualizing the BREP.

    My plan was to define the BREP data-structures and try to implement the boolean algorithm on them. I started only with supporting planes as a surface. And then after awhile I was able to perform see first real results of my BREP boolean algorithm:

  • jSketcher is truly a wonderful development in cad software.

    mmiscool09/09/2017 at 05:14 0 comments

    just to clarify I am not the amazing dev behind this project. Val Erastov has done an amazing job of bringing parametric 3d solid modeling to the web. He has been worries to move from nurbs to brep and that is an admirable goal with real practical application. 

    jSketcher and are cross platform cad tools that enable people to design 3d models with out having to install any software locally. A web browser is all that is need. 

    That simple change is a paradigm shift for 3d modeling software and cad packages. The fact that it is open source and can be run on a variety of platforms is a change from existing packages. 

    I really hope you give the jSketcher a shot and send this guy some cash. There is a PayPal link at the bottom of the page at . It would be awsome to support this project and get cad tools in to the hands of any one with a web browser. 

View all 5 project logs

Enjoy this project?



teraz wrote 05/04/2022 at 16:20 point

1. is possible add a cnc router engine

2. is possible package it to electron

  Are you sure? yes | no

mmiscool wrote 05/06/2022 at 03:36 point

I see no reason it could not be packed in to a desktop app.

CNC stuff has not been a priority yet. If you skilled in javascript and cad software you can hop on to the discord here.

  Are you sure? yes | no

Noah Whitehouse wrote 12/24/2021 at 07:45 point

Parametric modeling is a great way of working. You can create complex shapes by using mathematical relations between parameters, which makes changes easy and reduces the amount of repetitive work needed for design. Now I need to know if is edubirdie safe because I am planning to hire an online writer from there to get help with an essay that I am willing to write about this wonderful topic.

  Are you sure? yes | no

adigo66 wrote 03/19/2018 at 08:04 point

Congrats! I'm highly excited (as  user) about this idea. There is no proper opensource modeller today, and we have seen what happens with online stuff like 123D.... I had myself this idea to combine nurbs with the browser (most logical because the data is smalll and there are libs at hand), but my programming skills are soo modest...Best regards!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates