@buerli.io/buerligons
Buerligons, the CAD app on buerli and ClassCAD (sketches, features, parts and assemblies), as one React component. With it comes what a host needs to open and save documents of its own, and to set the look of the 3D view.
What it exposes
- Buerligons: the whole app, the welcome page and then the editor of the active drawing.
- BuerligonsProps: its props: the welcome page, sharing, the menu, view only, the look it opens in.
- EditorController: opens, saves and closes the documents of a host that keeps its files itself.
- useEditorStatus, useEditorDirty, useEditedParts, useCurrentPart,
useAutosave: follow an
EditorControllerin React. - setRenderMode, useRenderMode: the look of the 3D view, realistic or flat (RenderMode).
- setLooks: materials for the products, by name, in the realistic look (Look).
The host connects with buerli's own init (@buerli.io/classcad) and any client; Buerligons prepares each client
itself. The app fills its container, which needs a size. A host that keeps its documents itself opens and saves
them with an EditorController and renders <Buerligons welcome={false} />.
Example
import { createRoot } from 'react-dom/client'
import { init, WASMClient } from '@buerli.io/classcad'
import { Buerligons } from '@buerli.io/buerligons'
// How a drawing reaches ClassCAD: here the engine runs in the page, with a public token of a classcad.ch account
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }))
// The app fills its container, which needs a size
createRoot(document.getElementById('root')!).render(
<div style={{ height: '100vh' }}>
<Buerligons />
</div>,
)
API
| Name | Description |
|---|---|
| App | The app as one React component, and its props. Every host needs it: <Buerligons /> in a container with a size, once init has connected buerli. |
| Documents | Opening, saving and closing documents from the host's side, and following them in React. A host needs it when it keeps the files itself (a PDM, a portal) and renders <Buerligons welcome={false} />; the app's own File menu needs none of it. |
| Looks | How the 3D view draws: the realistic or the flat look, and materials for the products in the realistic look. A host needs it to switch the look from controls of its own, or to give its products the materials they are made of. |