Solid
ApiNoHistory#
A simple and intuitive javascript based api that incorporates solid operations like shapes, booleans (unions, subtracts, intersections), extrusions, revolves, blends, chamfers, slices, arrays, patterns, offsets, etc. The api is compatible with THREEJS and understands some of its primitives like curves and paths.
box#
Creates a simple box.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| length | number | Length of the box (x-axis) | |
| width | number | Width of the box (y-axis) | |
| height | number | Height of the box (z-axis) |
Returns ID
Example

clearSolid#
Clears the target solid in the drawing.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to be deleted |
Returns Promise<void>
Example
clearSolids#
Clears all existing solids in the drawing.
Declaration
Returns Promise<void>
Example
cone#
Creates a simple cone.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| height | number | Height of the cone (z-axis) | |
| diameter1 | number | Diameter at the bottom of the cone | |
| diameter2 | number | Diameter at the top of the cone |
Returns ID
Example

copy#
Creates a copy of the solid.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to create a copy from |
Returns ID
Example

createBufferGeometry#
Creates the buffer geometry of the solid.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to create buffer geometry from |
Returns Promise<BufferGeometry | undefined>
Example
createScene#
Creates ThreeJS scene from the given solids.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solids | VID[] | Ids of the solids to create scene from | |
| options.meshPerGeometry? | boolean |
Returns Promise<{ scene: Scene; part: THREE.Group; solids: THREE.Group[]; meshes: THREE.Mesh[] }>
cylinder#
Creates a simple cylinder.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| height | number | Height of the cylinder (z-axis) | |
| diameter | number | Diamter of the cylinder |
Returns ID
Example

edgeLoops#
Returns all adjacent edges of a face or vertex
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| breps | VIDs | Face or vertex ids to get the adjacent edges from |
Returns IDs
Example

export#
Writes the current solid or specific solids to a stream in stp data format and returns the data.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidIds? | VIDs | [optional] specific solidIds to write to stream |
Returns Promise<Uint8Array | null>
Example
extendSolidAtPlane#
The solid is extended at the defined plane with a solid created by extruding the section defined by the plane.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| target | VID | ||
| point | Vec | Position of plane | |
| normal | Vec | Normal vector of plane | |
| distance | number | Distance of extension |
Returns Promise<void>
Example

extrude#
Creates an extrusion.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| height | Vec | Height of extrusion | |
| region | Polyline l THREE.Shape | Region which will be extruded, defined by Polyline or THREE.Shape |
Returns ID
Example

fillet#
Creates a fillet at the given edges
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| radius | number | Radius of the fillet | |
| edges | VIDs | Edges to create fillets on |
Returns ID
Example

getDrawing#
Returns the drawing of the current headless-session
Declaration
Returns DrawingState
DrawingState
Example
getDrawingId#
Returns the drawing id of the current headless-session
Declaration
Returns DrawingID
DrawingID
Example
getState#
Returns the state tree of the current headless-session
Declaration
Returns BuerliState
BuerliState
Example
import#
Loads an arraybuffer in stp file format. All solids existing in stp data will be returned in an array. Current drawing will not be overwritten, imports will just be added.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| data | ArrayBuffer | Data as arraybuffer in stp format |
Returns IDs
Example
intersect#
Creates an intersection between solid and bodies.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to intersect | |
| keepSolid | boolean | If true, the solid will be kept and can be used again | |
| bodies | VID[] | Bodies to intersect with the solid |
Returns ID
Example

load#
Loads an arraybuffer in native file format. Native file format is 'ofb', if you want to load 'stp' file formats, use import function. Current drawing will be overwritten by loaded data.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| data | ArrayBuffer | Data as arraybuffer in ofb format |
Returns IDs
mirror#
Mirrors the solid at the specified plane.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | ||
| point | Vec | Position of the mirror plane | |
| normal | Vec | Normal vector of the mirror plane |
Returns Promise<void>
Example

moveTo#
Moves the solid to the given position.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid which will be moved | |
| position | Vec | Position to move the solid to |
Returns Promise<void>
Example

offset#
Creates an offset of the solid.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Solid which becomes an offset | |
| offsetDistance | number | Distance of offset |
Returns ID
Example

pick#
Returns all edges or faces depending on type which matches the points.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to look for edges and faces | |
| type | 'vertex' l 'edge' l 'face' | Type of geometry to look for --> 'edge' or 'face' | |
| points | Vec[] | Points where edges and faces will be expected |
Returns IDs
Example

revolve#
Revolves the given region.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| position | Vec | Position of rotation axis | |
| direction | Vec | Direction of rotation axis | |
| angle | number | Angle of rotation in rad | |
| region | Polyline l THREE.Shape | Region which will be revolved, defined by Polyline or THREE.Shape |
Returns ID
Example

rotateTo#
Rotates the given solid.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to rotate | |
| rotationVec | Vec | Vector of rotation around x-, y- and z-axis |
Returns Promise<void>
Example

save#
Writes the current drawing as native file format to a stream and returns the data. Native file is 'ofb', for 'stp' file format use export method.
Important notes about the ofb format:
- It contains binary geometry blocks.
- Do not try to convert it to text, the geometry blocks will get damaged!
Declaration
Returns Promise<Uint8Array | null>
Example
scale#
Scales the solid in all or specified axis.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to scale | |
| vectorOrFactor | Vec l number | If factor is defined, the solid will be scaled in all direction with same scale value. Otherwise in the given x, y and z direction of the vector. |
Returns Promise<void>
Example

setFacetingParameters#
Sets the global faceting parameters that will stick for this drawing. This defines how detailed solids will be displayed and can yield smaller payloads.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| distanceTol | number | Distance tolerance | |
| angleTol | number | Angle tolerance |
Returns Promise<void>
Void
Example
setFacetingParams#
Sets the faceting parameters of graphic objects. This defines how detailed solids will be displayed.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| distanceTol | number | Tolerated distance between theoretic and tesselated arc | |
| angleTol | number | Tolerated angle between normal vectors of faces which build an arc |
Returns ID
Example

slice#
Slices the solid at specified plane. Part of solid which is on the positive side of defined plane will be removed.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of solid to slice | |
| point | Vec | Position of plane | |
| normal | Vec | Normal vector of plane |
Returns Promise<void>
Example

sphere#
Creates a simple sphere.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| radius | number | Radius of the sphere |
Returns ID
Example

subtract#
Creates a subtraction between solid and bodies.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to subtract | |
| keepSolid | boolean | If true, the solid will be kept and can be used again | |
| bodies | VID[] | Bodies to subtract from the solid |
Returns ID
Example

union#
Creates an union between solid and bodies.
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| solidId | VID | Id of the solid to unify | |
| keepSolid | boolean | If true, the solid will be kept and can be used again | |
| bodies | VID[] | Bodies to unify with the solid |
Returns ID
Example

createPolyline#
Creates a polyline from the given fillet points
Declaration
Params
| Name | Type | Default | Description |
|---|---|---|---|
| fPts | FilletPoint[] | Points of the polyline with its associated fillet radius |
Returns Polyline
Example
FilletPoint#
Point definition where the fillet will be added with a specified radius.
Members
| Name | Type | Description |
|---|---|---|
| point | Vector3 | Point where the corner of the polyline will be. |
| radius | number | Radius of the fillet at the position of point. |
Polyline#
Polyline of points and bulges. Bulges define the arc between the current and the next point.
Members
| Name | Type | Description |
|---|---|---|
| points | Vector3[] | Points where the corners of the polyline will be. |
| bulges | number[] | Bulges which define the arcs. |