Skip to main content

Icons

The app's icons: small drawings in two tones of ink, by name. They are also in @buerli.io/react-cad/icons, with nothing but React.

Components​

Icon​

const Icon: React.FC<IconProps>;

Draws one of the app's icons: a sign on a 20 × 20 sheet, in two tones of the theme's ink.

It is an inline <svg> that the stylesheet (AppStyle) inks: its lines are the theme's ink, what a sign is done to is grey, and an axis is in its own colour. It is given the drawing's name, or a url that is a reference (iconRef) or an image's url, which it shows as an <img>. A name that has no drawing shows a dashed square. The drawings are icons. Its props: IconProps.

Example​

// on a page that only needs the icons: nothing but React
import { Icon, iconDataUrl, iconRef } from '@buerli.io/react-cad/icons'

const ToolButton = ({ onClick }: { onClick: () => void }) => (
<button className="rcad-tool" onClick={onClick} title="Extrude">
<Icon name="extrusion" size={20} />
</button>
)
// a reference goes where an image's url went before; an image's url still shows as an <img>
const Fillet = () => <Icon url={iconRef('fillet')} size={16} title="Fillet" />
const Logo = () => <Icon url="/logo.svg" size={24} title="Our app" />
// where no stylesheet reaches: the same drawing in colours of its own
const Favicon = () => <link rel="icon" href={iconDataUrl('part', { ink: '#e7000b' }, 32)} />

Objects​

icons​

const icons: {
angle: IconLayer[];
angleOX: (["sub", string] | ["", string])[];
anglePattern: IconLayer[];
angleZ: IconLayer[];
appearance: (["tone", string] | ["", string])[];
arc: (["fill", string] | ["sub", string])[];
arc3Points: (["fill", string] | ["", string])[];
arcCenter: (["fill", string] | ["sub", string] | ["", string])[];
arcTangent: (["fill", string] | ["sub", string] | ["", string])[];
arrowRight: string;
assembly: (["sub", string] | ["tone", string] | ["", string])[];
axisX: IconLayer[];
axisY: IconLayer[];
axisZ: IconLayer[];
back: string;
barycenter: (["fill", string] | ["sub", string])[];
bbox: (["tone", string] | ["", string] | ["sub-dash", string])[];
box: (["tone", string] | ["", string])[];
boxHeight: IconLayer[];
boxLength: IconLayer[];
boxWidth: IconLayer[];
capSheet: IconLayer[];
capSolid: (["tone", string] | ["", string])[];
caret: string;
chamfer: (["sub", string] | ["", string])[];
chamferAngle: IconLayer[];
chamferOffset1: (["sub", string] | ["", string])[];
chamferOffset2: (["sub", string] | ["", string])[];
check: string;
chevronDown: string;
chevronLeft: string;
chevronRight: string;
chevronUp: string;
circleCenter: (
| ["fill", string]
| ["sub", string]
| ["tone", string]
| ["", string])[];
circularPattern: IconLayer[];
circularPatternConstraint: IconLayer[];
close: string;
coincident: (["fill", string] | ["sub", string] | ["", string])[];
colinear: (["", string] | ["sub-dash", string])[];
compositeCurve: (["fill", string] | ["", string])[];
concentric: (["fill", string] | ["", string])[];
cone: (["tone", string] | ["", string])[];
coneBase: IconLayer[];
coneHeight: (["sub", string] | ["", string])[];
coneTop: IconLayer[];
constructionLine: (["fill", string] | ["dash", string])[];
copy: (["sub", string] | ["tone", string] | ["", string])[];
countAngular: IconLayer[];
countX: IconLayer[];
countY: IconLayer[];
csysFrom: (["sub", string] | ["", string])[];
csysTo: (["sub", string] | ["", string])[];
cylinder: (["tone", string] | ["", string])[];
cylinderHeight: (["sub", string] | ["", string])[];
cylindrical: (["sub", string] | ["", string])[];
diameter: (["sub", string] | ["", string])[];
dimHorizontal: IconLayer[];
dimLinear: (["sub-fill", string] | ["sub", string] | ["", string])[];
dims: (["sub", string] | ["", string])[];
dimVertical: IconLayer[];
direction: (["sub", string] | ["", string])[];
direction3d: (["sub", string] | ["", string])[];
directionCurve: (["sub", string] | ["", string])[];
directionPlanes: (["sub", string] | ["", string])[];
directionPoints: (["sub-fill", string] | ["", string])[];
directionX: IconLayer[];
directionY: IconLayer[];
distanceX: IconLayer[];
distanceY: IconLayer[];
distanceZ: (["sub", string] | ["z", string])[];
download: string;
edges: (["fill", string] | ["sub", string] | ["", string])[];
edit: string;
enter: (["sub", string] | ["", string])[];
entityDeletion: (["sub", string] | ["", string])[];
equal: (["sub", string] | ["", string])[];
error: string;
export: string;
expressions: string;
extrusion: (["tone", string] | ["", string])[];
eye: (["fill", string] | ["tone", string] | ["", string])[];
eyeOff: (["sub-fill", string] | ["sub", string] | ["", string])[];
face: IconLayer[];
fastened: (["fill", string] | ["sub", string])[];
fastenedOrigin: (["sub", string] | ["", string])[];
file: string;
fillet: (["sub", string] | ["", string])[];
filletRadius: (["fill", string] | ["sub", string] | ["", string])[];
fixed: (["fill", string] | ["", string])[];
flipX: IconLayer[];
flipXInv: IconLayer[];
flipY: IconLayer[];
flipYInv: IconLayer[];
flipZ: IconLayer[];
flipZInv: IconLayer[];
gear: (["sub-fill", string] | ["sub", string] | ["", string])[];
gearFirst: IconLayer[];
gearRatio: IconLayer[];
gearSecond: IconLayer[];
grip: ["fill", string][];
group: (["sub-fill", string] | ["dash", string])[];
horizontal: (["sub-fill", string] | ["sub", string] | ["", string])[];
import: string;
info: string;
innerCircle: (["fill", string] | ["sub", string])[];
instance: (["tone", string] | ["", string])[];
instances: (["tone", string] | ["", string])[];
instancesOpen: string;
intersection: (["fill", string] | ["sub", string] | ["", string])[];
intersectionPoint: (["fill", string] | ["sub", string])[];
limitDown: (["sub", string] | ["", string])[];
limitUp: (["sub", string] | ["", string])[];
line: (["fill", string] | ["", string])[];
linearPattern: IconLayer[];
linearPatternConstraint: IconLayer[];
lineOnPlane: (["sub", string] | ["", string])[];
link: string;
look: (["sub", string] | ["tone", string] | ["", string])[];
loop: (["fill", string] | ["sub", string] | ["", string])[];
mate1: IconLayer[];
mate2: IconLayer[];
measure: (["tone", string] | ["", string])[];
menu: string;
merged: IconLayer[];
message: string;
midpoint: (["sub-fill", string] | ["fill", string] | ["sub", string])[];
midpointLine: (["fill", string] | ["sub", string])[];
midpointPoints: (["sub-fill", string] | ["fill", string])[];
minus: string;
mirror: (
| ["sub", string]
| ["tone", string]
| ["", string]
| ["axis", string])[];
mirrorLine: (["sub-fill", string] | ["", string])[];
missing: ["sub-dash", string][];
more: ["fill", string][];
normal: (["sub", string] | ["", string])[];
notMerged: (["tone", string] | ["", string])[];
offsetX: IconLayer[];
offsetXMax: IconLayer[];
offsetXMin: IconLayer[];
offsetY: IconLayer[];
offsetYMax: IconLayer[];
offsetYMin: IconLayer[];
offsetZ: IconLayer[];
offsetZMax: IconLayer[];
offsetZMin: IconLayer[];
open: string;
origin: (["fill", string] | ["sub", string])[];
parallel: (["sub", string] | ["", string])[];
parallelLines: ["", string][];
part: (["tone", string] | ["", string])[];
pattern2dCircular: IconLayer[];
pattern2dLinear: IconLayer[];
pattern2dMirror: (["sub-fill", string] | ["fill", string] | ["axis", string])[];
perpendicular: (["sub", string] | ["", string])[];
pin: string;
planar: (["sub", string] | ["", string])[];
planeFront: IconLayer[];
planeOffset: IconLayer[];
planeRight: IconLayer[];
planeTop: IconLayer[];
plus: string;
point: (["fill", string] | ["sub", string])[];
pointOnPlane: (["fill", string] | ["sub", string])[];
pointsOnPlane: (["fill", string] | ["sub", string])[];
position: (["fill", string] | ["sub", string])[];
products: string;
question: string;
radius: (["fill", string] | ["sub", string] | ["", string])[];
rect2Points: (["fill", string] | ["tone", string] | ["", string])[];
rectCenter: (["fill", string] | ["tone", string] | ["", string])[];
redo: string;
region: (["sub", string] | ["tone", string] | ["", string])[];
rename: (["sub", string] | ["", string])[];
reorient0: IconLayer[];
reorient180: IconLayer[];
reorient270: IconLayer[];
reorient90: IconLayer[];
revolute: (["sub", string] | ["", string])[];
revolve: (["sub-fill", string] | ["tone", string] | ["", string])[];
revolveAxis: (["sub", string] | ["", string])[];
revolveEnd: IconLayer[];
revolveStart: IconLayer[];
rigidSet: (["sub-fill", string] | ["dash", string])[];
rotation: IconLayer[];
rotation3d: (["sub", string] | ["", string])[];
rotationAngle: (["sub", string] | ["", string])[];
rotationX: IconLayer[];
rotationY: IconLayer[];
rotationZ: IconLayer[];
rotationZMax: IconLayer[];
rotationZMin: IconLayer[];
search: string;
select: (["tone", string] | ["", string])[];
session: (["sub", string] | ["", string])[];
sheet: IconLayer[];
sheetBody: IconLayer[];
sidebar: (["fill", string] | ["", string])[];
sidebarOff: (["sub", string] | ["", string])[];
sketch: (["fill", string] | ["tone", string] | ["", string])[];
sketchAngle: (["fill", string] | ["sub", string] | ["", string])[];
sketchCountAngular: IconLayer[];
sketchCountX: IconLayer[];
sketchCountY: IconLayer[];
sketchDirectionX: IconLayer[];
sketchDirectionY: IconLayer[];
sketchDistanceX: IconLayer[];
sketchDistanceY: IconLayer[];
sketchFillet: (["sub", string] | ["", string])[];
slice: (["sub", string] | ["tone", string] | ["", string])[];
sliceBySheet: (["sub", string] | ["tone", string] | ["", string])[];
slider: (["sub", string] | ["", string])[];
solid: (["tone", string] | ["", string])[];
solidLine: (["fill", string] | ["", string])[];
sphere: (["tone", string] | ["", string])[];
spherical: (["sub", string] | ["tone", string] | ["", string])[];
sphericalMax: (["sub", string] | ["", string])[];
split: (["fill", string] | ["", string])[];
subtraction: (["tone", string] | ["", string] | ["sub-dash", string])[];
success: string;
switchDirection1: string;
switchDirection2: string;
switchNormal1: (["sub", string] | ["", string])[];
switchNormal2: (["sub", string] | ["", string])[];
switchX1: IconLayer[];
switchX2: IconLayer[];
switchY1: IconLayer[];
switchY2: IconLayer[];
symmetric: (["fill", string] | ["", string] | ["axis", string])[];
tangent: (["fill", string] | ["sub", string] | ["", string])[];
theme: (["fill", string] | ["", string])[];
toSubassembly: (["sub", string] | ["", string])[];
transformByCsys: IconLayer[];
translation: IconLayer[];
translationDistance: (["sub", string] | ["", string])[];
trash: string;
trim: (["sub", string] | ["", string] | ["sub-dash", string])[];
twist: (["tone", string] | ["", string])[];
twistAngle: (["sub", string] | ["", string])[];
undo: string;
union: (["tone", string] | ["", string])[];
useGeometry: IconLayer[];
useReference: IconLayer[];
vertical: (["sub-fill", string] | ["sub", string] | ["", string])[];
viewEdges: (["", string] | ["sub-dash", string])[];
viewFaces: (["tone", string] | ["", string])[];
viewNormal: (["sub", string] | ["tone", string] | ["", string])[];
viewPoints: (["fill", string] | ["sub", string])[];
viewWire: (["sub", string] | ["", string])[];
warning: string;
workAxis: (["fill", string] | ["", string])[];
workCSys: (["fill", string] | ["", string])[];
workPlane: IconLayer[];
workPoint: (["fill", string] | ["", string])[];
zoomFit: (["tone", string] | ["", string])[];
};

Every drawing the app has, by name: what Icon draws.

The sheets are the app's own signs (its bars, rows and menus), the features, the sketch's tools and constraints, what a field sets (a length, a count, an angle, along an axis), what a field picks, the mates of an assembly, and a few glyphs. missing is the dashed square that stands in for a name that has no drawing.

Type Declaration​

NameTypeDescription
angleIconLayer[]An angle between two lines.
angleOX(["sub", string] | ["", string])[]A line's angle against the X axis.
anglePatternIconLayer[]The angle from one copy to the next, about the axis that was picked.
angleZIconLayer[]The angle from one copy to the next, about a mate's Z.
appearance(["tone", string] | ["", string])[]A drop: the appearance, a body's colour.
arc(["fill", string] | ["sub", string])[]The centre of an arc.
arc3Points(["fill", string] | ["", string])[]An arc through three points.
arcCenter(["fill", string] | ["sub", string] | ["", string])[]An arc by its centre and its ends.
arcTangent(["fill", string] | ["sub", string] | ["", string])[]An arc that leaves a line's end the way the line runs.
arrowRightstringAn arrow to the right.
assembly(["sub", string] | ["tone", string] | ["", string])[]Two bodies: an assembly.
axisXIconLayer[]The part's X axis.
axisYIconLayer[]The part's Y axis.
axisZIconLayer[]The part's Z axis.
backstringAn arrow to the left: back.
barycenter(["fill", string] | ["sub", string])[]The middle of a body's face.
bbox(["tone", string] | ["", string] | ["sub-dash", string])[]A block in a dashed cube: the bounding box.
box(["tone", string] | ["", string])[]Box.
boxHeightIconLayer[]A box's height: the edges along Z.
boxLengthIconLayer[]A box's length: the edges along X.
boxWidthIconLayer[]A box's width: the edges along Y.
capSheetIconLayer[]The walls alone: make a sheet.
capSolid(["tone", string] | ["", string])[]A closed body: make a solid.
caretstringA wide chevron down: opens a set, such as a tool button's.
chamfer(["sub", string] | ["", string])[]Chamfer: an edge cut.
chamferAngleIconLayer[]A chamfer's angle against the face.
chamferOffset1(["sub", string] | ["", string])[]A chamfer's measure along the one face.
chamferOffset2(["sub", string] | ["", string])[]A chamfer's measure along the other face.
checkstringA tick: done, on.
chevronDownstringA chevron down.
chevronLeftstringA chevron to the left.
chevronRightstringA chevron to the right: a row or a section that opens.
chevronUpstringA chevron up.
circleCenter( | ["fill", string] | ["sub", string] | ["tone", string] | ["", string])[]A circle by its centre and a point on it.
circularPatternIconLayer[]Circular pattern: a body repeated about an axis.
circularPatternConstraintIconLayer[]An instance repeated about a point (the assembly's circular pattern).
closestringA cross: close.
coincident(["fill", string] | ["sub", string] | ["", string])[]Coincident: two points held as one.
colinear(["", string] | ["sub-dash", string])[]Colinear: two lines held on one line.
compositeCurve(["fill", string] | ["", string])[]A curve through points: several curves taken as one.
concentric(["fill", string] | ["", string])[]Concentric: circles held about one centre.
cone(["tone", string] | ["", string])[]Cone.
coneBaseIconLayer[]The diameter of a cone's base.
coneHeight(["sub", string] | ["", string])[]A cone's height.
coneTopIconLayer[]The diameter of a cone's top.
constructionLine(["fill", string] | ["dash", string])[]A construction line: dashed, not part of the profile.
copy(["sub", string] | ["tone", string] | ["", string])[]Two sheets, one over the other: copy.
countAngularIconLayer[]A pattern's count about its axis.
countXIconLayer[]A pattern's count along its first axis.
countYIconLayer[]A pattern's count along its second axis.
csysFrom(["sub", string] | ["", string])[]The coordinate system to start from.
csysTo(["sub", string] | ["", string])[]The coordinate system to go to.
cylinder(["tone", string] | ["", string])[]Cylinder.
cylinderHeight(["sub", string] | ["", string])[]A cylinder's height.
cylindrical(["sub", string] | ["", string])[]Cylindrical: a turn about an axis, free to slide along it too.
diameter(["sub", string] | ["", string])[]A diameter: across a circle.
dimHorizontalIconLayer[]A horizontal dimension.
dimLinear(["sub-fill", string] | ["sub", string] | ["", string])[]A dimension along a line.
dims(["sub", string] | ["", string])[]A span between two rules: the dimensions.
dimVerticalIconLayer[]A vertical dimension.
direction(["sub", string] | ["", string])[]A direction along a line.
direction3d(["sub", string] | ["", string])[]A direction given by its coordinates.
directionCurve(["sub", string] | ["", string])[]A direction the way a curve runs.
directionPlanes(["sub", string] | ["", string])[]A direction along where two planes meet.
directionPoints(["sub-fill", string] | ["", string])[]A direction from one point to another.
directionXIconLayer[]The X axis picked as a direction.
directionYIconLayer[]The Y axis picked as a direction.
distanceXIconLayer[]A pattern's spacing along its first axis.
distanceYIconLayer[]A pattern's spacing along its second axis.
distanceZ(["sub", string] | ["z", string])[]A pattern's spacing up the axis it turns about.
downloadstringAn arrow down into a tray: download.
edges(["fill", string] | ["sub", string] | ["", string])[]An edge of a body, picked.
editstringA pen: edit.
enter(["sub", string] | ["", string])[]An arrow into a frame: go into a product to work on it.
entityDeletion(["sub", string] | ["", string])[]A cube, crossed out: a body or a face taken out of a part again.
equal(["sub", string] | ["", string])[]Equal: two lines held as long, or two circles as large, as each other.
errorstringA cross in a disc: an error.
exportstringAn arrow up out of a tray: export.
expressionsstringAn f and an x: the expressions.
extrusion(["tone", string] | ["", string])[]Extrusion: a profile raised into a body.
eye(["fill", string] | ["tone", string] | ["", string])[]An eye: shown.
eyeOff(["sub-fill", string] | ["sub", string] | ["", string])[]The eye struck through: hidden.
faceIconLayer[]A face of a body, picked.
fastened(["fill", string] | ["sub", string])[]Fastened: two instances held to one another.
fastenedOrigin(["sub", string] | ["", string])[]Fastened origin: an instance held to the ground.
filestringA sheet with a folded corner: a file.
fillet(["sub", string] | ["", string])[]Fillet: an edge rounded.
filletRadius(["fill", string] | ["sub", string] | ["", string])[]A fillet's radius: from the centre to the round.
fixed(["fill", string] | ["", string])[]Fixed: a point held where it is.
flipXIconLayer[]A mate whose main axis is X.
flipXInvIconLayer[]A mate whose main axis is -X.
flipYIconLayer[]A mate whose main axis is Y.
flipYInvIconLayer[]A mate whose main axis is -Y.
flipZIconLayer[]A mate whose main axis is Z.
flipZInvIconLayer[]A mate whose main axis is -Z.
gear(["sub-fill", string] | ["sub", string] | ["", string])[]Gear: two turns, the one driving the other.
gearFirstIconLayer[]A gear's first wheel.
gearRatioIconLayer[]How a gear's one wheel turns against the other: its ratio.
gearSecondIconLayer[]A gear's second wheel.
grip["fill", string][]Six dots: what is dragged.
group(["sub-fill", string] | ["dash", string])[]Group: several instances held as one.
horizontal(["sub-fill", string] | ["sub", string] | ["", string])[]Horizontal: a line held level.
importstringAn arrow down into a tray: import.
infostringAn i in a disc: a note.
innerCircle(["fill", string] | ["sub", string])[]The centre of the circle three lines hold.
instance(["tone", string] | ["", string])[]A body, picked.
instances(["tone", string] | ["", string])[]Several bodies, picked.
instancesOpenstringSeveral bodies that are taken away (the other bodies of a cut).
intersection(["fill", string] | ["sub", string] | ["", string])[]Intersection: what two bodies share.
intersectionPoint(["fill", string] | ["sub", string])[]Where two lines cross.
limitDown(["sub", string] | ["", string])[]How far an extrusion goes down from its sketch's plane.
limitUp(["sub", string] | ["", string])[]How far an extrusion goes up from its sketch's plane.
line(["fill", string] | ["", string])[]A line between two points.
linearPatternIconLayer[]Linear pattern: a body repeated along a line.
linearPatternConstraintIconLayer[]An instance repeated along a line (the assembly's linear pattern).
lineOnPlane(["sub", string] | ["", string])[]A plane through a line.
linkstringTwo links of a chain: a link.
look(["sub", string] | ["tone", string] | ["", string])[]A lit ball: how the bodies are drawn.
loop(["fill", string] | ["sub", string] | ["", string])[]A loop: the chain of edges around a face, picked.
mate1IconLayer[]The mate on the first of two instances to be joined.
mate2IconLayer[]The mate on the second of two instances to be joined.
measure(["tone", string] | ["", string])[]A ruler: measure.
menustringThree bars: a menu.
mergedIconLayer[]Two bodies made one: merge the solids.
messagestringA speech bubble: messages.
midpoint(["sub-fill", string] | ["fill", string] | ["sub", string])[]Midpoint: a point held in a line's middle.
midpointLine(["fill", string] | ["sub", string])[]The middle of a line.
midpointPoints(["sub-fill", string] | ["fill", string])[]The middle between two points.
minusstringA minus: remove.
mirror( | ["sub", string] | ["tone", string] | ["", string] | ["axis", string])[]Mirror: a body repeated in a mirror.
mirrorLine(["sub-fill", string] | ["", string])[]The line a sketch is mirrored in.
missing["sub-dash", string][]A dashed square: what stands in for a name that has no drawing.
more["fill", string][]Three dots: more, a row's menu.
normal(["sub", string] | ["", string])[]A direction that stands on a plane: its normal.
notMerged(["tone", string] | ["", string])[]Two bodies left two: keep the solids apart.
offsetXIconLayer[]An offset along X.
offsetXMaxIconLayer[]The upper limit of an offset along X.
offsetXMinIconLayer[]The lower limit of an offset along X.
offsetYIconLayer[]An offset along Y.
offsetYMaxIconLayer[]The upper limit of an offset along Y.
offsetYMinIconLayer[]The lower limit of an offset along Y.
offsetZIconLayer[]An offset along Z.
offsetZMaxIconLayer[]The upper limit of an offset along Z.
offsetZMinIconLayer[]The lower limit of an offset along Z.
openstringA folder: open.
origin(["fill", string] | ["sub", string])[]The part's origin.
parallel(["sub", string] | ["", string])[]Parallel: two faces kept parallel.
parallelLines["", string][]Parallel: two lines held parallel.
part(["tone", string] | ["", string])[]A part.
pattern2dCircularIconLayer[]Shapes of a sketch repeated about a point.
pattern2dLinearIconLayer[]Shapes of a sketch repeated along a line.
pattern2dMirror(["sub-fill", string] | ["fill", string] | ["axis", string])[]Shapes of a sketch mirrored in a line.
perpendicular(["sub", string] | ["", string])[]Perpendicular: two lines held at a right angle.
pinstringA pin: pin.
planar(["sub", string] | ["", string])[]Planar: free to slide on a plane.
planeFrontIconLayer[]The part's front plane.
planeOffsetIconLayer[]A plane at an offset from another.
planeRightIconLayer[]The part's right plane.
planeTopIconLayer[]The part's top plane.
plusstringA plus: add, create.
point(["fill", string] | ["sub", string])[]A point.
pointOnPlane(["fill", string] | ["sub", string])[]A plane through a point.
pointsOnPlane(["fill", string] | ["sub", string])[]A plane through three points.
position(["fill", string] | ["sub", string])[]A point given by its coordinates.
productsstringFour tiles: the products a model is put together from.
questionstringA question mark in a disc: help.
radius(["fill", string] | ["sub", string] | ["", string])[]A radius.
rect2Points(["fill", string] | ["tone", string] | ["", string])[]A rectangle by two corners.
rectCenter(["fill", string] | ["tone", string] | ["", string])[]A rectangle by its centre and a corner.
redostringAn arrow that turns on: redo.
region(["sub", string] | ["tone", string] | ["", string])[]A rectangle with a hole, filled: a region of a sketch.
rename(["sub", string] | ["", string])[]A field with its caret: rename.
reorient0IconLayer[]A mate as it lies, not turned about its main axis.
reorient180IconLayer[]A mate turned 180° about its main axis.
reorient270IconLayer[]A mate turned 270° about its main axis.
reorient90IconLayer[]A mate turned 90° about its main axis.
revolute(["sub", string] | ["", string])[]Revolute: a turn about an axis.
revolve(["sub-fill", string] | ["tone", string] | ["", string])[]Revolve: a profile turned about an axis into a body.
revolveAxis(["sub", string] | ["", string])[]The axis a revolve turns about.
revolveEndIconLayer[]Where a revolve's turn ends.
revolveStartIconLayer[]Where a revolve's turn starts.
rigidSet(["sub-fill", string] | ["dash", string])[]Rigid set: several shapes held as one.
rotationIconLayer[]Rotate: a body turned about an axis.
rotation3d(["sub", string] | ["", string])[]A turn in space.
rotationAngle(["sub", string] | ["", string])[]How far a body is turned.
rotationXIconLayer[]A turn about X.
rotationYIconLayer[]A turn about Y.
rotationZIconLayer[]A turn about Z.
rotationZMaxIconLayer[]The upper limit of a turn about Z.
rotationZMinIconLayer[]The lower limit of a turn about Z.
searchstringA lens: search.
select(["tone", string] | ["", string])[]A pointer: select.
session(["sub", string] | ["", string])[]Three people, linked: a shared session.
sheetIconLayer[]A sheet, as a row of the bodies' list.
sheetBodyIconLayer[]A sheet: a surface with no thickness, picked.
sidebar(["fill", string] | ["", string])[]The app's frame with its sidebar there: hide the sidebar.
sidebarOff(["sub", string] | ["", string])[]The frame with the sidebar put away: show the sidebar.
sketch(["fill", string] | ["tone", string] | ["", string])[]Sketch: a profile and its points.
sketchAngle(["fill", string] | ["sub", string] | ["", string])[]A sketch pattern's angle.
sketchCountAngularIconLayer[]A sketch pattern's count about its centre.
sketchCountXIconLayer[]A sketch pattern's count along its first direction.
sketchCountYIconLayer[]A sketch pattern's count along its second direction.
sketchDirectionXIconLayer[]A sketch pattern's first direction.
sketchDirectionYIconLayer[]A sketch pattern's second direction.
sketchDistanceXIconLayer[]A sketch pattern's spacing along its first direction.
sketchDistanceYIconLayer[]A sketch pattern's spacing along its second direction.
sketchFillet(["sub", string] | ["", string])[]A sketch's corner rounded.
slice(["sub", string] | ["tone", string] | ["", string])[]Slice: a body cut in two by a plane.
sliceBySheet(["sub", string] | ["tone", string] | ["", string])[]Slice by sheet: a body cut in two by a sheet.
slider(["sub", string] | ["", string])[]Slider: a block on its rail, free to slide one way.
solid(["tone", string] | ["", string])[]A body.
solidLine(["fill", string] | ["", string])[]A line of the profile.
sphere(["tone", string] | ["", string])[]Sphere.
spherical(["sub", string] | ["tone", string] | ["", string])[]Spherical: a ball in its cup, free to turn about a point.
sphericalMax(["sub", string] | ["", string])[]A ball joint's largest swing to either side.
split(["fill", string] | ["", string])[]A line cut in two.
subtraction(["tone", string] | ["", string] | ["sub-dash", string])[]Subtraction: the one body taken from the other.
successstringA tick in a disc: done.
switchDirection1stringA direction switch, the one way.
switchDirection2stringA direction switch, the other way.
switchNormal1(["sub", string] | ["", string])[]A normal switch, the one way.
switchNormal2(["sub", string] | ["", string])[]A normal switch, the other way.
switchX1IconLayer[]A switch of X, the one way.
switchX2IconLayer[]A switch of X, the other way.
switchY1IconLayer[]A switch of Y, the one way.
switchY2IconLayer[]A switch of Y, the other way.
symmetric(["fill", string] | ["", string] | ["axis", string])[]Symmetric: two points held either side of a line.
tangent(["fill", string] | ["sub", string] | ["", string])[]Tangent: a curve that leaves another the way it runs.
theme(["fill", string] | ["", string])[]A disc, half inked: the theme.
toSubassembly(["sub", string] | ["", string])[]Three tiles and a plus: convert to a subassembly.
transformByCsysIconLayer[]Transform by coordinate systems: a body moved from one to another.
translationIconLayer[]Translate: a body moved along a line.
translationDistance(["sub", string] | ["", string])[]How far a body is moved.
trashstringA bin: delete.
trim(["sub", string] | ["", string] | ["sub-dash", string])[]A line cut back.
twist(["tone", string] | ["", string])[]Twist: a profile raised with a twist.
twistAngle(["sub", string] | ["", string])[]A twist's angle: the turn about the way it rises.
undostringAn arrow that turns back: undo.
union(["tone", string] | ["", string])[]Union: two bodies joined into one.
useGeometryIconLayer[]An edge of the body taken into the sketch as a line of its own.
useReferenceIconLayer[]An edge of the body taken into the sketch as a reference only.
vertical(["sub-fill", string] | ["sub", string] | ["", string])[]Vertical: a line held upright.
viewEdges(["", string] | ["sub-dash", string])[]A cube's edges, the hidden ones dashed: show the edges.
viewFaces(["tone", string] | ["", string])[]A cube with its faces: show the faces.
viewNormal(["sub", string] | ["tone", string] | ["", string])[]An arrow that stands on a plane: look along a plane's normal.
viewPoints(["fill", string] | ["sub", string])[]A cube's corners: show the points.
viewWire(["sub", string] | ["", string])[]A cube's wires: show the faces as wires.
warningstringAn exclamation mark in a triangle: a warning.
workAxis(["fill", string] | ["", string])[]Work axis.
workCSys(["fill", string] | ["", string])[]Work coordinate system.
workPlaneIconLayer[]Work plane.
workPoint(["fill", string] | ["", string])[]Work point.
zoomFit(["tone", string] | ["", string])[]Corners around a square: zoom to fit.

Example​

import { Icon, icons } from '@buerli.io/react-cad'
import type { IconName } from '@buerli.io/react-cad'

// a sheet of every icon there is, each with its name
const Sheet = () => (
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(8, 1fr)', gap: 12 }}>
{(Object.keys(icons) as IconName[]).map((name) => (
<figure key={name}>
<Icon name={name} size={32} title={name} />
<figcaption>{name}</figcaption>
</figure>
))}
</div>
)

Functions​

iconDataUrl()​

function iconDataUrl(
name,
inks,
size?,
seenAt?
): string;

An icon as a data: url of its svg (iconSvg): for an <img>, a CSS background or a texture's loader.

Parameters​

ParameterTypeDefault valueDescription
namestringundefinedThe drawing's name, or its reference (iconRef).
inks{ ink: string; x?: string; y?: string; z?: string; }undefinedIts colours, such as { ink: '#0f1320' }.
inks.inkstringundefinedThe ink: what the sign is about. What it is done to is the same, at 46 %.
inks.x?stringundefinedThe X axis' colour. Default: the ink.
inks.y?stringundefinedThe Y axis' colour. Default: the ink.
inks.z?stringundefinedThe Z axis' colour. Default: the ink.
size?number20The svg's width and height in px. Default 20.
seenAt?numbersizeThe size in px it is seen at, which its lines are weighed for. Default: size.

Returns​

string

Example​

import { iconDataUrl, useRCadTheme } from '@buerli.io/react-cad'

// an icon as an <img>, in the theme's colours: the axes in their own
function AxisBadge() {
const colors = useRCadTheme()
const src = iconDataUrl('rotation3d', { ink: colors.ink, x: colors.axisX, y: colors.axisY, z: colors.axisZ }, 24)
return <img src={src} width={24} height={24} alt="Rotation" />
}

iconRef()​

function iconRef(name): string;

An icon's reference: a string ('rcad:extrusion') that goes wherever an image's url went before.

It goes into a plugin description's iconUrl or a menu item's icon, say: Icon draws it from its url, and shows anything else it is handed there as the image it is. iconSvg and iconDataUrl take it too.

Parameters​

ParameterTypeDescription
name| "pointOnPlane" | "normal" | "origin" | "radius" | "position" | "slice" | "edges" | "box" | "message" | "copy" | "products" | "error" | "success" | "info" | "warning" | "theme" | "search" | "split" | "trim" | "fixed" | "link" | "angle" | "enter" | "loop" | "menu" | "select" | "line" | "cylindrical" | "sphere" | "spherical" | "group" | "part" | "rotation" | "direction" | "close" | "flipY" | "arc" | "cone" | "union" | "instance" | "mirror" | "appearance" | "caret" | "solid" | "region" | "horizontal" | "vertical" | "open" | "sheet" | "edit" | "mate1" | "mate2" | "instances" | "undo" | "redo" | "face" | "cylinder" | "point" | "twist" | "offsetX" | "offsetY" | "intersection" | "slider" | "download" | "file" | "more" | "translationDistance" | "equal" | "sketch" | "back" | "chevronLeft" | "chevronRight" | "chevronDown" | "chevronUp" | "arrowRight" | "check" | "plus" | "minus" | "grip" | "sidebar" | "sidebarOff" | "eye" | "eyeOff" | "trash" | "rename" | "pin" | "export" | "import" | "question" | "toSubassembly" | "session" | "viewFaces" | "viewWire" | "viewEdges" | "viewPoints" | "look" | "dims" | "measure" | "bbox" | "zoomFit" | "viewNormal" | "expressions" | "extrusion" | "revolve" | "subtraction" | "fillet" | "chamfer" | "sliceBySheet" | "linearPattern" | "circularPattern" | "translation" | "transformByCsys" | "workPlane" | "workAxis" | "workPoint" | "workCSys" | "axisX" | "axisY" | "axisZ" | "planeTop" | "planeFront" | "planeRight" | "assembly" | "entityDeletion" | "compositeCurve" | "boxLength" | "boxWidth" | "boxHeight" | "limitUp" | "limitDown" | "capSolid" | "capSheet" | "twistAngle" | "revolveAxis" | "revolveStart" | "revolveEnd" | "cylinderHeight" | "diameter" | "coneHeight" | "coneBase" | "coneTop" | "filletRadius" | "chamferOffset1" | "chamferOffset2" | "chamferAngle" | "distanceX" | "distanceY" | "distanceZ" | "countX" | "countY" | "countAngular" | "anglePattern" | "angleZ" | "rotationAngle" | "merged" | "notMerged" | "gearFirst" | "gearSecond" | "gearRatio" | "sphericalMax" | "offsetXMin" | "offsetXMax" | "offsetYMin" | "offsetYMax" | "offsetZ" | "offsetZMin" | "offsetZMax" | "directionX" | "directionY" | "rotationX" | "rotationY" | "rotationZ" | "rotationZMin" | "rotationZMax" | "rotation3d" | "switchDirection1" | "switchDirection2" | "switchNormal1" | "switchNormal2" | "switchX1" | "switchX2" | "switchY1" | "switchY2" | "flipX" | "flipXInv" | "flipYInv" | "flipZ" | "flipZInv" | "reorient0" | "reorient90" | "reorient180" | "reorient270" | "rect2Points" | "rectCenter" | "circleCenter" | "arcTangent" | "arcCenter" | "arc3Points" | "sketchFillet" | "useGeometry" | "useReference" | "solidLine" | "constructionLine" | "mirrorLine" | "coincident" | "tangent" | "parallelLines" | "perpendicular" | "colinear" | "concentric" | "midpoint" | "symmetric" | "rigidSet" | "dimHorizontal" | "dimVertical" | "dimLinear" | "angleOX" | "pattern2dLinear" | "pattern2dCircular" | "pattern2dMirror" | "sketchDistanceX" | "sketchDistanceY" | "sketchDirectionX" | "sketchDirectionY" | "sketchCountX" | "sketchCountY" | "sketchCountAngular" | "sketchAngle" | "instancesOpen" | "sheetBody" | "csysFrom" | "csysTo" | "direction3d" | "directionPoints" | "directionPlanes" | "directionCurve" | "planeOffset" | "pointsOnPlane" | "lineOnPlane" | "barycenter" | "midpointPoints" | "midpointLine" | "innerCircle" | "intersectionPoint" | "fastenedOrigin" | "fastened" | "revolute" | "planar" | "parallel" | "linearPatternConstraint" | "circularPatternConstraint" | "gear" | "missing"The drawing's name.

Returns​

string

Example​

import { Icon, iconRef } from '@buerli.io/react-cad'

// what took an image's url takes the reference: it is drawn as the sign, in the theme's ink
const tools = [
{ name: 'Extrude', iconUrl: iconRef('extrusion') },
{ name: 'Logo', iconUrl: '/logo.svg' },
]
const Tools = () => (
<>{tools.map((tool) => <Icon key={tool.name} url={tool.iconUrl} size={20} title={tool.name} />)}</>
)

Types​

IconName​

type IconName = keyof typeof icons;

The name of one of the app's drawings: a key of icons, such as 'extrusion'.


IconProps​

type IconProps = {
className?: string;
name?: IconName;
size?: number;
style?: React.CSSProperties;
title?: string;
url?: string;
};

Props of Icon.

Properties​

PropertyTypeDescription
className?stringA class for the <svg>, besides rcad-icon.
name?IconNameA drawing's name.
size?numberIts width and height in px. Its lines keep their weight on the screen at any size. Default 20.
style?React.CSSPropertiesIts style.
title?stringWhat it says to a screen reader (and an image's alt). Without it, the icon is hidden from one.
url?stringOr its reference (see iconRef), or the url of an image, which is shown as an <img>.

Advanced​

Most apps do not need these directly: types they meet through the exports above, and what is there for special cases or for building on buerli itself.

IconDrawing​

type IconDrawing = string | readonly IconLayer[];

An icon's drawing: its layers, back to front, each a pen and an SVG path on the 20 × 20 sheet ([pen, d]); or, for a sign that is one path in ink, just that path.

The pens are '' (ink: what the sign is about), 'sub' (grey: what it is done to), 'dash' and 'sub-dash', 'axis' (grey, chain-dashed), 'fill' and 'sub-fill' (filled), 'tone' (a wash of ink: the face of what the sign is about), and 'x', 'y', 'z' (a line in an axis' own colour). In a path, a part in square brackets is filled as well as drawn: an arrow's head, M3 10H13[M17 10L13 8V12Z].

Example​

import type { IconDrawing } from '@buerli.io/react-cad'

// a sign that is one path in ink, and one in layers: what is done to in grey, what it is about in ink
const plus: IconDrawing = 'M10 4v12M4 10h12'
const eyeOff: IconDrawing = [
['sub', 'M2 10C4 6.7 6.8 5 10 5s6 1.7 8 5c-2 3.3-4.8 5-8 5s-6-1.7-8-5Z'],
['', 'M4 16 16 4'],
]

iconSvg()​

function iconSvg(
name,
inks,
size?,
seenAt?
): string;

An icon as a standalone svg, its colours written into it: for where no stylesheet reaches.

That is a texture on the canvas, say, or an image's url (iconDataUrl). Its lines are weighed for the size it is seen at, which a texture drawn large, to stay sharp, and shown small says apart from its size.

Parameters​

ParameterTypeDefault valueDescription
namestringundefinedThe drawing's name, or its reference (iconRef).
inks{ ink: string; x?: string; y?: string; z?: string; }undefinedIts colours, such as { ink: '#0f1320' }.
inks.inkstringundefinedThe ink: what the sign is about. What it is done to is the same, at 46 %.
inks.x?stringundefinedThe X axis' colour. Default: the ink.
inks.y?stringundefinedThe Y axis' colour. Default: the ink.
inks.z?stringundefinedThe Z axis' colour. Default: the ink.
size?number20The svg's width and height in px. Default 20.
seenAt?numbersizeThe size in px it is seen at, which its lines are weighed for. Default: size.

Returns​

string

The svg's markup.

Example​

import * as THREE from 'three'
import { getStage, iconSvg } from '@buerli.io/react-cad'

// a sign as a texture on the stage: drawn at 96 px to stay sharp, its lines weighed for 16 px on screen
const stage = getStage()
const svg = iconSvg('workPlane', { ink: stage.datum }, 96, 16)
const texture = new THREE.TextureLoader().load('data:image/svg+xml;utf8,' + encodeURIComponent(svg))
const material = new THREE.SpriteMaterial({ map: texture, transparent: true })