Rayity

rayity > “shape”

External module: “shape”

Module for creating shape distance functions

Index

Interfaces

Functions


Functions

box

box(dimensions: Expression): Shape

Defined in shape.ts:354

A box with aritrary dimensions

Parameters:

Param Type Description
dimensions Expression -

Returns: Shape


choose

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

cube(): Shape

Defined in shape.ts:76

Cube of width 1

Returns: Shape


cylinder

cylinder(): Shape

Defined in shape.ts:136

Cylinder of diameter 1 along the (0, 1, 0) axis

Returns: Shape


difference

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

dodecahedron(): Shape

Defined in shape.ts:111

Dodecahedron with circumscribed diameter of 1.

Returns: Shape


expand

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

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


max

max(a: Shape): Shape

Defined in shape.ts:170

Parameters:

Param Type Description
a Shape -

Returns: Shape


mirror

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

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

octohedron(): Shape

Defined in shape.ts:92

Octohedron with circumscribed diameter of 1

Returns: Shape


offset

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

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

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

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

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

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

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

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

shape(call: function): Shape

Defined in shape.ts:15

Create a Shape

Parameters:

Param Type Description
call function -

Returns: Shape


sierpinski

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

skull(): Shape

Defined in shape.ts:463

Skull

Returns: Shape


smoothBox

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

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

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

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

sphere(): Shape

Defined in shape.ts:38

Sphere of diameter 1

Returns: Shape


spheroid

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

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

tetrahedron(): Shape

Defined in shape.ts:61

Tetrahedron with circumscribed diameter of 1

Returns: Shape


torus

torus(): Shape

Defined in shape.ts:146

Torus with outer diameter of 1, inner radius of 0.1

Returns: Shape


translate

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

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

truchet(): Shape

Defined in shape.ts:440

Truchet

Returns: Shape


twistX

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

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

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

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

unit(): Shape

Defined in shape.ts:28

Unit distance function

Returns: Shape


wrapX

wrapX(a: Shape): Shape

Defined in shape.ts:315

Wrap a Shape about the x-axis

Parameters:

Param Type Description
a Shape -

Returns: Shape


zero

zero(): Shape

Defined in shape.ts:22

Null distance function

Returns: Shape