@classcad/react-cad 3.0.0-beta.20261120101705 → 3.0.0-beta.20261120102655
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -3
- package/build/components/UI/CAD/ViewPlugButtons.d.ts +2 -2
- package/build/components/UI/editors/LiveField.d.ts +15 -0
- package/build/icons/sheets.d.ts +1 -0
- package/build/icons/ui.d.ts +2 -0
- package/build/icons.cjs.js +2 -0
- package/build/icons.js +2 -0
- package/build/index.cjs.js +1688 -506
- package/build/index.d.ts +2 -1
- package/build/index.js +1662 -481
- package/build/plugins/SectionView/Root.d.ts +11 -0
- package/build/plugins/SectionView/View.d.ts +11 -0
- package/build/plugins/SectionView/caps.d.ts +25 -0
- package/build/plugins/SectionView/index.d.ts +30 -0
- package/build/plugins/SectionView/state.d.ts +36 -0
- package/build/utils/conversionUtils.d.ts +1 -1
- package/doc/api/icons.md +3 -1
- package/doc/api/panels.md +2 -2
- package/doc/api/tool-plugins.md +20 -0
- package/package.json +3 -3
- package/typedoc.json +2 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DrawingID, PluginID } from '@classcad/sdkjs';
|
|
3
|
+
/**
|
|
4
|
+
* The panel: which solids are cut, and the section planes.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const Root: React.FC<{
|
|
9
|
+
drawingId: DrawingID;
|
|
10
|
+
pluginId: PluginID;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DrawingID, PluginID } from '@classcad/sdkjs';
|
|
3
|
+
/**
|
|
4
|
+
* The section in the scene: the solids cut, and a gizmo for each plane.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export declare const View: React.FC<{
|
|
9
|
+
drawingId: DrawingID;
|
|
10
|
+
pluginId: PluginID;
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { type WebGPURenderer } from 'three/webgpu';
|
|
3
|
+
/**
|
|
4
|
+
* The cut drawn closed. Where the eye's ray enters what all planes keep, inside a cut body, that body shows a face:
|
|
5
|
+
* its cap. Each frame the cut bodies are drawn, unclipped, in targets of their own: first the nearest back face
|
|
6
|
+
* beyond that point, and whose it is; then that body alone is counted up to the point, its front faces adding one
|
|
7
|
+
* and its back faces taking one away, so that a count of one says the point is inside it. (Counted alone, a body
|
|
8
|
+
* another overlaps, as a thread in its hole, keeps its cap; drawn as one shell per colour, its shells count
|
|
9
|
+
* together.) Then that body's back faces draw the cap at the point's depth. Only for WebGPURenderer.
|
|
10
|
+
*/
|
|
11
|
+
export type Section = {
|
|
12
|
+
/** Takes the planes as they are (cut where `distanceToPoint < 0`), seen from `camera` as it is now. */
|
|
13
|
+
update(planes: THREE.Plane[], camera: THREE.Camera): void;
|
|
14
|
+
/** Places the caps on their bodies, and draws the bodies for them, for the frame drawn next. */
|
|
15
|
+
count(renderer: WebGPURenderer, scene: THREE.Scene, camera: THREE.Camera): void;
|
|
16
|
+
/** How far apart the caps' hatch lines are, in model units. */
|
|
17
|
+
setHatch(spacing: number): void;
|
|
18
|
+
/** Starts capping a body: its cap goes into `root`, which no clipping group holds; shells of one `key` are one. */
|
|
19
|
+
add(body: THREE.Mesh, root: THREE.Object3D, key: string): void;
|
|
20
|
+
remove(body: THREE.Mesh): void;
|
|
21
|
+
/** The bodies capped. */
|
|
22
|
+
bodies(): THREE.Mesh[];
|
|
23
|
+
dispose(): void;
|
|
24
|
+
};
|
|
25
|
+
export declare function createSection(): Section;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A section view: the model cut by planes, to see inside it.
|
|
3
|
+
*
|
|
4
|
+
* It is a global plugin: an app adds it to `init`'s `globalPlugins`, and the `ViewPlugButtons` have a button that opens
|
|
5
|
+
* it. While it is open, each plane cuts away what its normal points to, from the picked solids only (Include) or from
|
|
6
|
+
* all but them (Exclude). A plane is moved and turned with its gizmo, typed in, or set from a work plane or a planar
|
|
7
|
+
* face. The cut is drawn by `WebGPURenderer` (Buerligons' stage); `WebGLRenderer` draws the model whole.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { init, WASMClient } from '@buerli.io/classcad'
|
|
12
|
+
* import { SectionView, elements } from '@buerli.io/react-cad'
|
|
13
|
+
*
|
|
14
|
+
* init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [SectionView] })
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @category Tool Plugins
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
import { PluginDescription } from '@classcad/sdkjs';
|
|
21
|
+
import { Root } from './Root';
|
|
22
|
+
import { View } from './View';
|
|
23
|
+
import { SectionViewState } from './state';
|
|
24
|
+
/**
|
|
25
|
+
* The plugin's description for buerli's plugin system.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
declare const description: PluginDescription<SectionViewState>;
|
|
30
|
+
export { Root, View, description };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { DrawingID, GraphicID, ObjectID, PluginID } from '@classcad/sdkjs';
|
|
3
|
+
type Vec3T = [number, number, number];
|
|
4
|
+
type QuatT = [number, number, number, number];
|
|
5
|
+
/** As many planes as a section has at most: as many as the caps take into account, and hardware clipping. */
|
|
6
|
+
export declare const MAX_PLANES = 8;
|
|
7
|
+
/** A section plane: a point on it, its normal (pointing to what is cut away), and how its gizmo is turned. */
|
|
8
|
+
export type SectionPlane = {
|
|
9
|
+
position: Vec3T;
|
|
10
|
+
normal: Vec3T;
|
|
11
|
+
/** Turns the gizmo's z axis onto the normal; the gizmo's x and y axes lie in the plane. */
|
|
12
|
+
rotation: QuatT;
|
|
13
|
+
};
|
|
14
|
+
/** Which solids are cut: only the picked ones, or all but them. */
|
|
15
|
+
export declare enum SectionMode {
|
|
16
|
+
Include = 0,
|
|
17
|
+
Exclude = 1
|
|
18
|
+
}
|
|
19
|
+
export type SolidRef = {
|
|
20
|
+
productId: ObjectID;
|
|
21
|
+
containerId: GraphicID;
|
|
22
|
+
};
|
|
23
|
+
export type SectionViewState = {
|
|
24
|
+
planes: SectionPlane[];
|
|
25
|
+
selected?: number;
|
|
26
|
+
mode: SectionMode;
|
|
27
|
+
solids: SolidRef[];
|
|
28
|
+
};
|
|
29
|
+
export declare const setState: (drawingId: DrawingID, pluginId: PluginID, state: Partial<SectionViewState> | ((s: SectionViewState) => Partial<SectionViewState>)) => void;
|
|
30
|
+
/** A plane through `position`; `normal` is kept as given (a typed one is not rewritten), its unit for the gizmo. */
|
|
31
|
+
export declare const planeAt: (position: THREE.Vector3, normal: THREE.Vector3) => SectionPlane;
|
|
32
|
+
export declare const planeFromMatrix: (matrix: THREE.Matrix4) => SectionPlane;
|
|
33
|
+
export declare const planeMatrix: (plane: SectionPlane) => THREE.Matrix4;
|
|
34
|
+
/** The model's centre, cut horizontally: what a new section starts as. */
|
|
35
|
+
export declare const defaultPlane: (drawingId: DrawingID) => SectionPlane;
|
|
36
|
+
export {};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @category Utilities
|
|
6
6
|
* @module
|
|
7
7
|
*/
|
|
8
|
-
import { DrawingID, ObjectID } from
|
|
8
|
+
import { DrawingID, ObjectID } from '@classcad/sdkjs';
|
|
9
9
|
import { MateParam } from '../components/UI/editors/RefsEditors';
|
|
10
10
|
/**
|
|
11
11
|
* A mate as `api.v1.assembly`'s constraint calls take it: its flip as `'X'` … `'-Z'`, its turn as `'0'` … `'270'`.
|
package/doc/api/icons.md
CHANGED
|
@@ -248,6 +248,7 @@ const icons: {
|
|
|
248
248
|
rotationZMax: IconLayer[];
|
|
249
249
|
rotationZMin: IconLayer[];
|
|
250
250
|
search: string;
|
|
251
|
+
section: (["tone", string] | ["", string] | ["sub-dash", string])[];
|
|
251
252
|
select: (["tone", string] | ["", string])[];
|
|
252
253
|
session: (["sub", string] | ["", string])[];
|
|
253
254
|
sheet: IconLayer[];
|
|
@@ -520,6 +521,7 @@ few glyphs. `missing` is the dashed square that stands in for a name that has no
|
|
|
520
521
|
| <a id="property-rotationzmax"></a> `rotationZMax` | `IconLayer`[] | The upper limit of a turn about Z. |
|
|
521
522
|
| <a id="property-rotationzmin"></a> `rotationZMin` | `IconLayer`[] | The lower limit of a turn about Z. |
|
|
522
523
|
| <a id="property-search"></a> `search` | `string` | A lens: search. |
|
|
524
|
+
| <a id="property-section"></a> `section` | (\[`"tone"`, `string`\] \| \[`""`, `string`\] \| \[`"sub-dash"`, `string`\])[] | A block cut through by a plane: the section view. |
|
|
523
525
|
| <a id="property-select"></a> `select` | (\[`"tone"`, `string`\] \| \[`""`, `string`\])[] | A pointer: select. |
|
|
524
526
|
| <a id="property-session"></a> `session` | (\[`"sub"`, `string`\] \| \[`""`, `string`\])[] | Three people, linked: a shared session. |
|
|
525
527
|
| <a id="property-sheet"></a> `sheet` | `IconLayer`[] | A sheet, as a row of the bodies' list. |
|
|
@@ -667,7 +669,7 @@ shows anything else it is handed there as the image it is. [iconSvg](#iconsvg) a
|
|
|
667
669
|
|
|
668
670
|
| Parameter | Type | Description |
|
|
669
671
|
| :------ | :------ | :------ |
|
|
670
|
-
| `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"` \| `"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"` \| `"translationDistance"` \| `"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"` \| `"spline"` \| `"intSpline"` \| `"bezier"` \| `"sketchFillet"` \| `"useGeometry"` \| `"useReference"` \| `"solidLine"` \| `"constructionLine"` \| `"mirrorLine"` \| `"coincident"` \| `"tangent"` \| `"equalCurvature"` \| `"parallelLines"` \| `"perpendicular"` \| `"colinear"` \| `"concentric"` \| `"midpoint"` \| `"symmetric"` \| `"equal"` \| `"equalRadius"` \| `"rigidSet"` \| `"dimHorizontal"` \| `"dimVertical"` \| `"dimLinear"` \| `"sketchDiameter"` \| `"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. |
|
|
672
|
+
| `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"` \| `"section"` \| `"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"` \| `"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"` \| `"translationDistance"` \| `"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"` \| `"spline"` \| `"intSpline"` \| `"bezier"` \| `"sketchFillet"` \| `"useGeometry"` \| `"useReference"` \| `"solidLine"` \| `"constructionLine"` \| `"mirrorLine"` \| `"coincident"` \| `"tangent"` \| `"equalCurvature"` \| `"parallelLines"` \| `"perpendicular"` \| `"colinear"` \| `"concentric"` \| `"midpoint"` \| `"symmetric"` \| `"equal"` \| `"equalRadius"` \| `"rigidSet"` \| `"dimHorizontal"` \| `"dimVertical"` \| `"dimLinear"` \| `"sketchDiameter"` \| `"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. |
|
|
671
673
|
|
|
672
674
|
#### Returns
|
|
673
675
|
|
package/doc/api/panels.md
CHANGED
|
@@ -366,8 +366,8 @@ const StageDocks = ({ drawingId }: { drawingId: DrawingID }) => (
|
|
|
366
366
|
const ViewPlugButtons: React.FC<ViewPlugButtonsProps>;
|
|
367
367
|
```
|
|
368
368
|
|
|
369
|
-
Buttons that open and close the global plugins laid over the stage: Dimensions, Measure, Bounding box,
|
|
370
|
-
Management.
|
|
369
|
+
Buttons that open and close the global plugins laid over the stage: Dimensions, Measure, Bounding box, Section view,
|
|
370
|
+
Session Management.
|
|
371
371
|
|
|
372
372
|
A button is there only where the drawing has the plugin (`init`'s `globalPlugins`); it switches the plugin on and
|
|
373
373
|
off, and its window is one of the [GlobalPlugins](#globalplugins). The Session Management button is not shown to a guest of a
|
package/doc/api/tool-plugins.md
CHANGED
|
@@ -162,6 +162,26 @@ const dimensionsId = drawing.plugin.global.find(id => drawing.plugin.refs[id].na
|
|
|
162
162
|
if (dimensionsId) drawing.api.plugin.setActiveGlobal(dimensionsId, true)
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
***
|
|
166
|
+
|
|
167
|
+
### SectionView {#sectionview}
|
|
168
|
+
|
|
169
|
+
A section view: the model cut by planes, to see inside it.
|
|
170
|
+
|
|
171
|
+
It is a global plugin: an app adds it to `init`'s `globalPlugins`, and the `ViewPlugButtons` have a button that opens
|
|
172
|
+
it. While it is open, each plane cuts away what its normal points to, from the picked solids only (Include) or from
|
|
173
|
+
all but them (Exclude). A plane is moved and turned with its gizmo, typed in, or set from a work plane or a planar
|
|
174
|
+
face. The cut is drawn by `WebGPURenderer` (Buerligons' stage); `WebGLRenderer` draws the model whole.
|
|
175
|
+
|
|
176
|
+
#### Example
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { init, WASMClient } from '@buerli.io/classcad'
|
|
180
|
+
import { SectionView, elements } from '@buerli.io/react-cad'
|
|
181
|
+
|
|
182
|
+
init(drawingId => new WASMClient(drawingId, { token: 'ccpk_…' }), { elements, globalPlugins: [SectionView] })
|
|
183
|
+
```
|
|
184
|
+
|
|
165
185
|
## Advanced
|
|
166
186
|
|
|
167
187
|
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 the SDK itself.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classcad/react-cad",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.20261120102655",
|
|
4
4
|
"homepage": "https://sdkjs.classcad.ch",
|
|
5
5
|
"description": "The CAD user interface on the ClassCAD SDK: feature dialogs, model tree, sketcher",
|
|
6
6
|
"author": "AWV Informatik AG <info@awv-informatik.ch>",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@babel/runtime": "^7.29.10",
|
|
87
|
-
"@classcad/client": "3.0.0-beta.
|
|
88
|
-
"@classcad/react": "3.0.0-beta.
|
|
87
|
+
"@classcad/client": "3.0.0-beta.20261120102655",
|
|
88
|
+
"@classcad/react": "3.0.0-beta.20261120102655",
|
|
89
89
|
"@dnd-kit/core": "^6.3.1",
|
|
90
90
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
91
91
|
"@dnd-kit/sortable": "^10.0.0",
|
package/typedoc.json
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://typedoc-plugin-markdown.org/schema.json",
|
|
3
|
-
"extends": [
|
|
4
|
-
"../../typedoc.base.json"
|
|
5
|
-
],
|
|
3
|
+
"extends": ["../../typedoc.base.json"],
|
|
6
4
|
"name": "@classcad/react-cad",
|
|
7
|
-
"entryPoints": [
|
|
8
|
-
"src/index.ts"
|
|
9
|
-
],
|
|
5
|
+
"entryPoints": ["src/index.ts"],
|
|
10
6
|
"tsconfig": "tsconfig.json",
|
|
11
7
|
"out": "doc/api",
|
|
12
8
|
"intentionallyNotDocumented": [
|