Skip to content

Instantly share code, notes, and snippets.

@fragmuffin
Last active August 28, 2017 02:43
Show Gist options
  • Save fragmuffin/51a29386b968e38149e80c30981eb261 to your computer and use it in GitHub Desktop.
Save fragmuffin/51a29386b968e38149e80c30981eb261 to your computer and use it in GitHub Desktop.
cadquery layer cake example of unwanted changes
import cadquery
from Helpers import show
# Layer Cake
# build layer cake by creating the base,
# then build on top of the base while retaining the base information
base = cadquery.Workplane('XY').circle(30).extrude(10)
cake = base.faces(">Z").workplane() \
.circle(20).extrude(10) \
.faces(">Z").workplane() \
.circle(10).extrude(10)
# base is expected to be just the first layer
# base is actually the first 2 layer
show(base)
# cake is as expected; all 3 layers
show(cake, (200, 200, 200, 0.8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment