Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3D -> 2D; xy working; xz, yz not working
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Neil Gershenfeld 7/12/15 | ||
|
||
import fab | ||
from fab.types import Shape | ||
|
||
title('Slice xy') | ||
|
||
def slice_xy(shape,z): | ||
slice_math = shape.math.replace('Z','f('+str(z)+')') | ||
return Shape(slice_math, | ||
shape.bounds.xmin,shape.bounds.ymin, | ||
shape.bounds.xmax,shape.bounds.ymax) | ||
|
||
input('shape',fab.types.Shape) | ||
input('z',float,0) | ||
|
||
output('slice',slice_xy(shape,z)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Neil Gershenfeld 7/12/15 | ||
|
||
import fab | ||
from fab.types import Shape | ||
|
||
title('Slice xz') | ||
|
||
def slice_xz(shape,y): | ||
slice_math = shape.math.replace('Y','f('+str(y)+')') | ||
slice_math = slice_math.replace('Z','Y') | ||
return Shape(slice_math, | ||
shape.bounds.xmin,shape.bounds.zmin, | ||
shape.bounds.xmax,shape.bounds.zmax) | ||
|
||
input('shape',fab.types.Shape) | ||
input('y',float,0) | ||
|
||
output('slice',slice_xz(shape,y)) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Neil Gershenfeld 7/12/15 | ||
|
||
import fab | ||
from fab.types import Shape | ||
|
||
title('Slice yz') | ||
|
||
def slice_yz(shape,x): | ||
slice_math = shape.math.replace('X','f('+str(x)+')') | ||
slice_math = slice_math.replace('Y','X') | ||
slice_math = slice_math.replace('Z','Y') | ||
return Shape(slice_math, | ||
shape.bounds.ymin,shape.bounds.zmin, | ||
shape.bounds.ymax,shape.bounds.zmax) | ||
|
||
input('shape',fab.types.Shape) | ||
input('x',float,0) | ||
|
||
output('slice',slice_yz(shape,x)) | ||
|