Module for creating shape distance functions
► box(dimensions: Expression): Shape
Defined in shape.ts:354
A box with aritrary dimensions
Parameters:
Param | Type | Description |
---|---|---|
dimensions | Expression | - |
Returns: Shape
► choose(x: Expression, shapes: Shape[]): Shape
Defined in shape.ts:430
Choose a shape randomly
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
shapes | Shape[] | - |
Returns: Shape
► cube(): Shape
Defined in shape.ts:76
Cube of width 1
Returns: Shape
► cylinder(): Shape
Defined in shape.ts:136
Cylinder of diameter 1 along the (0, 1, 0) axis
Returns: Shape
► difference(a: Shape, b: Shape): Shape
Defined in shape.ts:210
The difference of two Shapes
Parameters:
Param | Type | Description |
---|---|---|
a | Shape | - |
b | Shape | - |
Returns: Shape
► dodecahedron(): Shape
Defined in shape.ts:111
Dodecahedron with circumscribed diameter of 1.
Returns: Shape
► expand(k: Expression, a: Shape): Shape
Defined in shape.ts:247
Expand a Shape by distance k
Parameters:
Param | Type | Description |
---|---|---|
k | Expression | - |
a | Shape | - |
Returns: Shape
► intersection(a: Shape, b: Shape): Shape
Defined in shape.ts:201
The intersection of two Shapes
Parameters:
Param | Type | Description |
---|---|---|
a | Shape | - |
b | Shape | - |
Returns: Shape
Defined in shape.ts:170
Parameters:
Param | Type | Description |
---|---|---|
a | Shape | - |
Returns: Shape
► mirror(normal: Expression, a: Shape): Shape
Defined in shape.ts:324
Mirror a Shape
Parameters:
Param | Type | Description |
---|---|---|
normal | Expression | - |
a | Shape | - |
Returns: Shape
► modulate(x: Expression, a: function, buffer?: Expression): Shape
Defined in shape.ts:411
repeat where the repetition index can be used to generate the Shape
Parameters:
Param | Type | Default value | Description |
---|---|---|---|
x | Expression | - | - |
a | function | - | - |
buffer | Expression | value(0.01) | - |
Returns: Shape
► octohedron(): Shape
Defined in shape.ts:92
Octohedron with circumscribed diameter of 1
Returns: Shape
► offset(x: function, a: Shape): Shape
Defined in shape.ts:330
Offset a Shape
Parameters:
Param | Type | Description |
---|---|---|
x | function | - |
a | Shape | - |
Returns: Shape
► plane(normal: Expression, offset: Expression): Shape
Defined in shape.ts:44
Plane given a normal
and offset
Parameters:
Param | Type | Description |
---|---|---|
normal | Expression | - |
offset | Expression | - |
Returns: Shape
► repeat(x: Expression, a: Shape): Shape
Defined in shape.ts:186
Repeat a Shape with repetition factor x
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► rotate(axis: Expression, x: Expression, a: Shape): Shape
Defined in shape.ts:297
Rotate a Shape about an arbitrary axis
Parameters:
Param | Type | Description |
---|---|---|
axis | Expression | - |
x | Expression | - |
a | Shape | - |
Returns: Shape
► rotateX(x: Expression, a: Shape): Shape
Defined in shape.ts:273
Rotate a Shape about the x-axis
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► rotateY(x: Expression, a: Shape): Shape
Defined in shape.ts:281
Rotate a Shape about the y-axis
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► rotateZ(x: Expression, a: Shape): Shape
Defined in shape.ts:289
Rotate a Shape about the z-axis
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► scale(x: Expression, a: Shape): Shape
Defined in shape.ts:158
Scale a Shape by x
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► shape(call: function): Shape
Defined in shape.ts:15
Create a Shape
Parameters:
Param | Type | Description |
---|---|---|
call | function | - |
Returns: Shape
► sierpinski(iterations?: number
, a?: Shape): Shape
Defined in shape.ts:366
A sierpinksi fractal
Parameters:
Param | Type | Default value | Description |
---|---|---|---|
iterations | number |
5 | - |
a | Shape | tetrahedron() | - |
Returns: Shape
► skull(): Shape
Defined in shape.ts:463
Skull
Returns: Shape
► smoothBox(dimensions: Expression, radius: Expression): Shape
Defined in shape.ts:339
A box with rounded corners
Parameters:
Param | Type | Description |
---|---|---|
dimensions | Expression | - |
radius | Expression | - |
Returns: Shape
► smoothDifference(k: Expression, a: Shape, b: Shape): Shape
Defined in shape.ts:241
Smooth difference
Parameters:
Param | Type | Description |
---|---|---|
k | Expression | - |
a | Shape | - |
b | Shape | - |
Returns: Shape
► smoothIntersection(k: Expression, a: Shape, b: Shape): Shape
Defined in shape.ts:235
Smooth intersection
Parameters:
Param | Type | Description |
---|---|---|
k | Expression | - |
a | Shape | - |
b | Shape | - |
Returns: Shape
► smoothUnion(k: Expression, a: Shape, b: Shape): Shape
Defined in shape.ts:229
Smooth union
Parameters:
Param | Type | Description |
---|---|---|
k | Expression | - |
a | Shape | - |
b | Shape | - |
Returns: Shape
► sphere(): Shape
Defined in shape.ts:38
Sphere of diameter 1
Returns: Shape
► spheroid(x: function): Shape
Defined in shape.ts:166
Variable radius sphere with radius calculcated using x
Parameters:
Param | Type | Description |
---|---|---|
x | function | - |
Returns: Shape
► stretch(x: Expression, a: Shape): Shape
Defined in shape.ts:176
Stretch a Shape
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► tetrahedron(): Shape
Defined in shape.ts:61
Tetrahedron with circumscribed diameter of 1
Returns: Shape
► torus(): Shape
Defined in shape.ts:146
Torus with outer diameter of 1, inner radius of 0.1
Returns: Shape
► translate(x: Expression, a: Shape): Shape
Defined in shape.ts:152
Move a Shape by x
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► tree(iterations?: number
, shape?: Shape): Shape
Defined in shape.ts:384
A recursive tree Shape
Parameters:
Param | Type | Default value | Description |
---|---|---|---|
iterations | number |
7 | - |
shape | Shape | - | - |
Returns: Shape
► truchet(): Shape
Defined in shape.ts:440
Truchet
Returns: Shape
► twistX(x: Expression, a: Shape): Shape
Defined in shape.ts:255
Twist a Shape along the x-axis
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► twistY(x: Expression, a: Shape): Shape
Defined in shape.ts:261
Twist a Shape along the y-axis
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► twistZ(x: Expression, a: Shape): Shape
Defined in shape.ts:267
Twist a Shape along the z-axis
Parameters:
Param | Type | Description |
---|---|---|
x | Expression | - |
a | Shape | - |
Returns: Shape
► union(a: Shape, b: Shape): Shape
Defined in shape.ts:192
The union of two Shapes
Parameters:
Param | Type | Description |
---|---|---|
a | Shape | - |
b | Shape | - |
Returns: Shape
► unit(): Shape
Defined in shape.ts:28
Unit distance function
Returns: Shape
Defined in shape.ts:315
Wrap a Shape about the x-axis
Parameters:
Param | Type | Description |
---|---|---|
a | Shape | - |
Returns: Shape
► zero(): Shape
Defined in shape.ts:22
Null distance function
Returns: Shape