KittyCAD / documentation

The handwritten sections of the KittyCAD docs. Found a typo? make an edit :D !
MIT License
3 stars 3 forks source link

KCL samples missing const keyword, don't work in Zoo Modeling App #262

Open spoon16 opened 14 hours ago

spoon16 commented 14 hours ago

Missing const keywords from many of the code samples in the docs which means they don't work in the modeling app when copy and pasted.

For example see https://zoo.dev/docs/kcl/shell

This code (from the shell docs) doesn't work without modification when pasted into the Modeling App.

// Shell a sketch on face object on the end face.
size = 100
case = startSketchOn('XY')
  |> startProfileAt([-size, -size], %)
  |> line([2 * size, 0], %)
  |> line([0, 2 * size], %)
  |> tangentialArcTo([-size, size], %)
  |> close(%)
  |> extrude(65, %)

thing1 = startSketchOn(case, 'end')
  |> circle({
       center: [-size / 2, -size / 2],
       radius: 25
     }, %)
  |> extrude(50, %)

thing2 = startSketchOn(case, 'end')
  |> circle({
       center: [size / 2, -size / 2],
       radius: 25
     }, %)
  |> extrude(50, %)

// We put "thing1" in the shell function to shell the end face of the object.
shell({ faces: ['end'], thickness: 5 }, thing1)
franknoirot commented 11 hours ago

Thanks for filing @spoon16, we recently made those keywords optional in this PR but should have done a new version release of the app before we updated the docs! We're working to release v0.25.6 now, which once you receive that auto-update should allow you to use these new iterations of the KCL samples (and we actually added a command to be able to import samples directly without having to copy/paste).