Feature Plugins
The dialogs of a part's features, one plugin per feature class: the sketcher, extrusions, revolves and twists, the
primitives, Booleans, fillets and chamfers, slices, patterns, mirrors and transformations, imports. An app maps each
class to its plugin in init's plugins; react-cad's toolbar opens one for a new feature, and a double click in
the feature list for one that is there.
Plugins
Sketch
The sketcher, the Sketch feature's plugin: draws and constrains a sketch's curves on a plane.
It is the plugin of the feature class CC_Sketch: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new sketch and when one is double-clicked in the feature list. A sketch without a
plane first asks for one, with the base planes shown to pick from.
Then its panel has the drawing tools (point, line, rectangle, arc, circle, fillet, trim, split, and taking over geometry or references), the sketch's constraints, copy patterns (linear, circular, mirror), the list of its geometry and constraints, its regions, and its position: the plane, an axis and the origin. Its view draws the sketch with its constraints and dimensions in the scene and handles the pointer for the tools.
Example
import { createApi, init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Sketch } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCSketch]: Sketch },
})
// Code opens a new sketch in the part `partId` as the toolbar does: it makes one and makes it the active feature:
const sketch = await createApi(drawingId).v1.sketch.create({ id: partId })
getDrawing(drawingId).api.plugin.setActiveFeature(sketch.result)
Extrusion
The Extrusion feature's dialog: extrudes a sketch region, sketch curves or a composite curve into a solid or a sheet.
It is the plugin of the feature class CC_Extrusion: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new extrusion and when one is double-clicked in the feature list. The
dialog picks the profile and the type (up, down, symmetric or custom) and takes the height and the taper angle, or
for custom the lower and upper limits and the tilt direction; it switches between solid and sheet. Apply updates the
feature (part.updateExtrusion).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Extrusion } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCExtrusion]: Extrusion },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.extrusion` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(extrusionId)
Fillet
The Fillet feature's dialog: rounds solid edges with a constant radius.
It is the plugin of the feature class CC_ConstantRadiusFillet: an app maps the class to it in init's plugins,
and react-cad opens it when the toolbar makes a new fillet and when one is double-clicked in the feature list. The
dialog picks the edges, one by one or as loops, and takes the radius. Apply updates the feature
(part.updateFillet).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Fillet } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCConstantRadiusFillet]: Fillet },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.fillet` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(filletId)
Boolean
The Boolean feature's dialog: unites, subtracts or intersects solids, a first body with the other bodies.
It is the plugin of the feature classes CC_Union, CC_Subtraction and CC_Intersection: an app maps each of them
to it in init's plugins, and react-cad opens it when the toolbar makes a new Boolean and when one is
double-clicked in the feature list. The dialog switches between the three operations and picks the first body and the
other bodies. Apply updates the feature (part.updateBoolean).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { Boolean as BooleanPlugin, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: {
[ScgClassType.CCUnion]: BooleanPlugin,
[ScgClassType.CCSubtraction]: BooleanPlugin,
[ScgClassType.CCIntersection]: BooleanPlugin,
},
})
// Code opens one by making it the active feature, with the id that `api.v1.part.boolean` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(booleanId)
Box
The Box feature's dialog: sets a box's length, width and height and the coordinate system it is placed at.
It is the plugin of the feature class CC_Box: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new box and when one is double-clicked in the feature list. The dialog picks the
origin coordinate system and takes the sizes as numbers or expressions. Apply updates the feature (part.updateBox).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { Box, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCBox]: Box },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.box` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(boxId)
Chamfer
The Chamfer feature's dialog: bevels solid edges by a distance, two distances, or a distance and an angle.
It is the plugin of the feature class CC_Chamfer: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new chamfer and when one is double-clicked in the feature list. The dialog picks
the type and the edges, one by one or as loops, and takes the offsets or the angle; a button swaps the two distances.
Apply updates the feature (part.updateChamfer).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { Chamfer, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCChamfer]: Chamfer },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.chamfer` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(chamferId)
CircularPattern
The Circular Pattern feature's dialog: copies a solid about an axis.
It is the plugin of the feature class CC_CircularPattern: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new circular pattern and when one is double-clicked in the feature list.
The dialog picks the solid and the axis, takes the angle between the copies and their number, inverts the axis, and
merges the copies into the solid or keeps them apart. Apply updates the feature (part.updateCircularPattern).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { CircularPattern, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCCircularPattern]: CircularPattern },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.circularPattern` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(patternId)
CompositeCurve
The Composite Curve feature's dialog: joins sketch curves and solid edges into one curve.
It is the plugin of the feature class CC_CompositeCurve: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new composite curve and when one is double-clicked in the feature list.
The dialog picks the curves: sketch lines, arcs and circles and solid edges, with loops of edges or, switched to its
other mode, faces. Apply updates the feature (part.updateCompositeCurve).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { CompositeCurve, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCCompositeCurve]: CompositeCurve },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.compositeCurve` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(curveId)
Cone
The Cone feature's dialog: sets a cone's bottom and top diameters, its height and the coordinate system it is placed at.
It is the plugin of the feature class CC_Cone: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new cone and when one is double-clicked in the feature list. The dialog picks the
origin coordinate system and takes the sizes as numbers or expressions. Apply updates the feature
(part.updateCone).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { Cone, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCCone]: Cone },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.cone` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(coneId)
Cylinder
The Cylinder feature's dialog: sets a cylinder's diameter and height and the coordinate system it is placed at.
It is the plugin of the feature class CC_Cylinder: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new cylinder and when one is double-clicked in the feature list. The dialog picks
the origin coordinate system and takes the sizes as numbers or expressions. Apply updates the feature
(part.updateCylinder).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { Cylinder, elements } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCCylinder]: Cylinder },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.cylinder` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(cylinderId)
EntityDeletion
The Entity Deletion feature's dialog: removes solids from the part.
It is the plugin of the feature class CC_EntityDeletion: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new entity deletion and when one is double-clicked in the feature list.
The dialog picks the solids. Apply updates the feature (part.updateEntityDeletion).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, EntityDeletion } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCEntityDeletion]: EntityDeletion },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.entityDeletion` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(deletionId)
Import
The Import feature's dialog: brings a STEP file into the part.
It is the plugin of the feature class CC_Import: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new import and when one is double-clicked in the feature list. The dialog takes a
.stp or .step file and refuses others with a message; Apply reads the file and updates the feature
(part.updateImportFeature).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Import } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCImport]: Import },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.importFeature` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(importId)
LinearPattern
The Linear Pattern feature's dialog: copies a solid along one or two axes.
It is the plugin of the feature class CC_LinearPattern: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new linear pattern and when one is double-clicked in the feature list.
The dialog picks the solid, the first axis and optionally a second one, takes the offset and the number of copies
along each, inverts an axis, and merges the copies into the solid or keeps them apart. Apply updates the feature
(part.updateLinearPattern).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, LinearPattern } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCLinearPattern]: LinearPattern },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.linearPattern` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(patternId)
Mirror
The Mirror feature's dialog: copies solids mirrored at planes.
It is the plugin of the feature class CC_Mirror: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new mirror and when one is double-clicked in the feature list. The dialog picks the
solids and the mirror planes (work planes or planar solid faces). Apply updates the feature (part.updateMirror).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Mirror } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCMirror]: Mirror },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.mirror` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(mirrorId)
Revolve
The Revolve feature's dialog: revolves a sketch region, sketch curves or a composite curve about an axis.
It is the plugin of the feature class CC_Revolve: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new revolve and when one is double-clicked in the feature list. The dialog picks
the profile and the axis (a sketch line, a work axis, a solid edge, or two points), takes the start and end angles
and inverts the axis. Apply updates the feature (part.updateRevolve).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Revolve } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCRevolve]: Revolve },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.revolve` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(revolveId)
Rotate
The Rotation feature's dialog: turns solids about an axis by an angle.
It is the plugin of the feature class CC_Rotation: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new rotation and when one is double-clicked in the feature list. The dialog picks
the solids and the axis (a sketch line, a work axis, a solid edge, or two points), takes the angle and inverts the
axis. Apply updates the feature (part.updateRotation).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Rotate } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCRotation]: Rotate },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.rotation` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(rotationId)
Slice
The Slice feature's dialog: cuts solids with a work plane.
It is the plugin of the feature class CC_Slice: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new slice and when one is double-clicked in the feature list. The dialog picks the
solids and the work plane and inverts the cut direction. Apply updates the feature (part.updateSlice).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Slice } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCSlice]: Slice },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.slice` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(sliceId)
SliceBySheet
The Slice by Sheet feature's dialog: cuts a solid with a sheet.
It is the plugin of the feature class CC_SliceBySheet: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new slice by sheet and when one is double-clicked in the feature list.
The dialog picks the solid and the sheet and inverts the cut direction. Apply updates the feature
(part.updateSliceBySheet).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, SliceBySheet } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCSliceBySheet]: SliceBySheet },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.sliceBySheet` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(sliceId)
Sphere
The Sphere feature's dialog: sets a sphere's radius and the coordinate system it is placed at.
It is the plugin of the feature class CC_Sphere: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new sphere and when one is double-clicked in the feature list. The dialog picks the
origin coordinate system and takes the radius as a number or an expression. Apply updates the feature
(part.updateSphere).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Sphere } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCSphere]: Sphere },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.sphere` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(sphereId)
TransformByCsys
The Transform by Coordinate System feature's dialog: moves solids from one coordinate system to another.
It is the plugin of the feature class CC_TransformationByCSys: an app maps the class to it in init's plugins,
and react-cad opens it when the toolbar makes a new transformation and when one is double-clicked in the feature
list. The dialog picks the solids and the coordinate systems to move them from and to. Apply updates the feature
(part.updateTransformationByCSys).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, TransformByCsys } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCTransformationByCSys]: TransformByCsys },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.transformationByCSys` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(transformationId)
Translate
The Translation feature's dialog: moves solids along a direction by a distance.
It is the plugin of the feature class CC_Translation: an app maps the class to it in init's plugins, and
react-cad opens it when the toolbar makes a new translation and when one is double-clicked in the feature list. The
dialog picks the solids and the direction (a sketch line, a work axis, a solid edge, or two points), takes the
distance and inverts the direction. Apply updates the feature (part.updateTranslation).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Translate } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCTranslation]: Translate },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.translation` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(translationId)
Twist
The Twist feature's dialog: extrudes a sketch region, sketch curves or a composite curve and twists it by an angle.
It is the plugin of the feature class CC_Twist: an app maps the class to it in init's plugins, and react-cad
opens it when the toolbar makes a new twist and when one is double-clicked in the feature list. The dialog picks the
profile and the type (up, down, symmetric or custom) and takes the height, or for custom the lower and upper limits,
the rotation center and the direction, and the twist angle; it switches between solid and sheet. Apply updates the
feature (part.updateTwist).
Example
import { init, ScgClassType, WASMClient } from '@buerli.io/classcad'
import { getDrawing } from '@buerli.io/core'
import { elements, Twist } from '@buerli.io/react-cad'
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), {
elements,
plugins: { [ScgClassType.CCTwist]: Twist },
})
// Code opens one by making it the active feature, with the id that `api.v1.part.twist` returns:
getDrawing(drawingId).api.plugin.setActiveFeature(twistId)