diff --git a/grilledemo.html b/grilledemo.html new file mode 100644 index 0000000..22a5c79 --- /dev/null +++ b/grilledemo.html @@ -0,0 +1,338 @@ + + + + + + + + + + +OpenJsCad demo: Parametric Grille + + +

OpenJsCad demo: Parametric Grille

+
+

Source code

+Below is the OpenJsCad script for this demo. To build your own models, create a .jscad script +and use the OpenJsCad parser. For more information see the +OpenJsCad documentation. +

+
+ +

+ + \ No newline at end of file diff --git a/index.html b/index.html index 20f218b..ee8c989 100644 --- a/index.html +++ b/index.html @@ -122,6 +122,7 @@ Alt+drag zooms (by changing the distance between camera and model).
  • Involute Gears
  • Parametric S hook: shows how to extrude 2d paths
  • Servo motor: shows how to work with properties and connectors
  • +
  • Parametric Grille
  • License

    Copyright (c) 2012 Joost Nieuwenhuijse. @@ -466,6 +467,15 @@ path = path.close(); // close the path // of course we could simply have done: // var path = new CSG.Path2D([[10,10], [-10,10], [-10,-10], [10,-10]], /* closed = */ true); +// We can make arcs and circles: +var curvedpath = CSG.Path2D.arc({ + center: [0,0,0], + radius: 10, + startangle: 0, + endangle: 180, + resolution: 16, +}); + // Extrude the path by following it with a rectangle (upright, perpendicular to the path direction) // Returns a CSG solid // width: width of the extrusion, in the z=0 plane