@classcad/react-cad 3.0.0-beta.20261119100608 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @buerli.io/react-cad
2
2
 
3
- ## 3.0.0-beta.20261119100608
3
+ ## 3.0.0-beta.20261120102655
4
4
 
5
5
  ### Major Changes
6
6
 
@@ -14,6 +14,8 @@
14
14
  ### Minor Changes
15
15
 
16
16
  - The Extrusion and Revolve dialogs combine the new solid with target bodies in one feature: a union, a subtraction or an intersection, chosen next to the type, with the targets picked in the scene. A target is a body, so one body of a pattern can be a target on its own. The dialogs call `part.updateExtrusion` and `part.updateRevolve` with the targets as the feature and the body's place among its bodies, as the Mirror, Boolean and Pattern dialogs reference bodies.
17
+ - Section View allows creating clipping planes which prevent parts of meshes that are on the clipping side from being rendered. Up to 8 such planes can be added. Excluding solids from being sectioned can be done
18
+ with adding them to selection in the 'Exclude' mode. Sectioning only concrete solids can done with adding them to selection in the 'Include' mode.
17
19
  - Sketches draw NURBS curves. Three new tools sit next to the circle: a spline and a Bezier curve shaped by their control points, and an interpolation spline through the fit points. Each point is picked in turn; a double click ends the curve at 3 or more points. Ctrl draws one as construction geometry, as with the other tools. A new Equal Curvature constraint was added.
18
20
  - The model tree knows where its rows stand. `@classcad/react` gets `ScgTreeWalker`, which walks the structure tree from a node down and renders every node with its `ObjectPath` (the ids from the root down to it), and `buildObjectPath`, which makes that path for any object. react-cad's assembly tree is built on the walker: the interaction infos its rows make carry the instance's `objectPath`, the rows stay unfolded as they were left (in react-cad's store, not in the row), the header unfolds or folds them all, and a selection on the stage unfolds the tree to the instance it hit and scrolls its row into view. A folded row mounts nothing below it, and a row renders again only when its own answer to hover and selection changes, so a big assembly costs what is visible: on the Ducati (761 instances) a click in the tree went from 300-470 ms to 20-40 ms and folding all rows from 600 ms to 55 ms.
19
21
 
@@ -24,8 +26,8 @@
24
26
  - On WebGPU a curved body's silhouette follows the view. It stayed where it was first drawn, a black line across the body. Seams, where a curved face meets itself, are now drawn like every other edge, so the edge that can be picked is the edge that is seen.
25
27
  - The sidebar's lists follow what is picked on the stage: a feature, an instance, a body, a constraint or a sketch element picked in the view is scrolled into view in its list, however long the list. An instance picked inside a folded sub-assembly is found at the sub-assembly's row. Only the list moves, never the page; rows picked together show the topmost of them.
26
28
  - Updated dependencies
27
- - @classcad/client@3.0.0-beta.20261119100608
28
- - @classcad/react@3.0.0-beta.20261119100608
29
+ - @classcad/client@3.0.0-beta.20261120102655
30
+ - @classcad/react@3.0.0-beta.20261120102655
29
31
 
30
32
  ## 2.0.0
31
33
 
@@ -10,8 +10,8 @@ export type ViewPlugButtonsProps = {
10
10
  drawingId: DrawingID;
11
11
  };
12
12
  /**
13
- * Buttons that open and close the global plugins laid over the stage: Dimensions, Measure, Bounding box, Session
14
- * Management.
13
+ * Buttons that open and close the global plugins laid over the stage: Dimensions, Measure, Bounding box, Section view,
14
+ * Session Management.
15
15
  *
16
16
  * A button is there only where the drawing has the plugin (`init`'s `globalPlugins`); it switches the plugin on and
17
17
  * off, and its window is one of the {@link GlobalPlugins}. The Session Management button is not shown to a guest of a
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { MemberParam } from '../../../types';
3
+ export type FieldProps<T> = {
4
+ value: T;
5
+ same: (a: T, b: T) => boolean;
6
+ accept: (v: unknown) => v is T;
7
+ onWrite: (value: T) => void;
8
+ changed: boolean;
9
+ options?: {
10
+ [key: string]: any;
11
+ };
12
+ render: (param: MemberParam<any>) => React.ReactElement;
13
+ };
14
+ /** An editor of a value that may change from elsewhere (a gizmo): it is mounted anew when it does. */
15
+ export declare function LiveField<T>({ value, same, onWrite, ...props }: FieldProps<T>): React.JSX.Element;
@@ -281,6 +281,7 @@ export declare const drawings: {
281
281
  dims: (["sub", string] | ["", string])[];
282
282
  measure: (["tone", string] | ["", string])[];
283
283
  bbox: (["tone", string] | ["", string] | ["sub-dash", string])[];
284
+ section: (["tone", string] | ["", string] | ["sub-dash", string])[];
284
285
  zoomFit: (["tone", string] | ["", string])[];
285
286
  viewNormal: (["sub", string] | ["tone", string] | ["", string])[];
286
287
  appearance: (["tone", string] | ["", string])[];
@@ -103,6 +103,8 @@ export declare const ui: {
103
103
  measure: (["tone", string] | ["", string])[];
104
104
  /** A block in a dashed cube: the bounding box. */
105
105
  bbox: (["tone", string] | ["", string] | ["sub-dash", string])[];
106
+ /** A block cut through by a plane: the section view. */
107
+ section: (["tone", string] | ["", string] | ["sub-dash", string])[];
106
108
  /** Corners around a square: zoom to fit. */
107
109
  zoomFit: (["tone", string] | ["", string])[];
108
110
  /** An arrow that stands on a plane: look along a plane's normal. */
@@ -373,6 +373,8 @@ const ui = sheet({
373
373
  measure: [['tone', 'M12.6 3 17 7.4 7.4 17 3 12.6Z'], ['', 'M12.6 3 17 7.4 7.4 17 3 12.6ZM9.9 5.7l2 2M7.2 8.4l2 2']],
374
374
  /** A block in a dashed cube: the bounding box. */
375
375
  bbox: [['sub-dash', cube.lines], ['tone', inner.top], ['', inner.lines]],
376
+ /** A block cut through by a plane: the section view. */
377
+ section: [['sub-dash', 'M10 3.4v13.2'], ['tone', rect(3.6, 5, 6.4, 10, 1.2)], ['', rect(3.6, 5, 6.4, 10, 1.2) + 'M10 5h5.2c.7 0 1.2.5 1.2 1.2v7.6c0 .7-.5 1.2-1.2 1.2H10']],
376
378
  // ---- the view: all of it in the frame; along a plane's normal; how a body looks
377
379
  /** Corners around a square: zoom to fit. */
378
380
  zoomFit: [['', 'M3.5 7V3.5H7M13 3.5h3.5V7M16.5 13v3.5H13M7 16.5H3.5V13'], ['tone', rect(7.2, 7.2, 5.6, 5.6, 1)], ['', rect(7.2, 7.2, 5.6, 5.6, 1)]],
package/build/icons.js CHANGED
@@ -369,6 +369,8 @@ const ui = sheet({
369
369
  measure: [['tone', 'M12.6 3 17 7.4 7.4 17 3 12.6Z'], ['', 'M12.6 3 17 7.4 7.4 17 3 12.6ZM9.9 5.7l2 2M7.2 8.4l2 2']],
370
370
  /** A block in a dashed cube: the bounding box. */
371
371
  bbox: [['sub-dash', cube.lines], ['tone', inner.top], ['', inner.lines]],
372
+ /** A block cut through by a plane: the section view. */
373
+ section: [['sub-dash', 'M10 3.4v13.2'], ['tone', rect(3.6, 5, 6.4, 10, 1.2)], ['', rect(3.6, 5, 6.4, 10, 1.2) + 'M10 5h5.2c.7 0 1.2.5 1.2 1.2v7.6c0 .7-.5 1.2-1.2 1.2H10']],
372
374
  // ---- the view: all of it in the frame; along a plane's normal; how a body looks
373
375
  /** Corners around a square: zoom to fit. */
374
376
  zoomFit: [['', 'M3.5 7V3.5H7M13 3.5h3.5V7M16.5 13v3.5H13M7 16.5H3.5V13'], ['tone', rect(7.2, 7.2, 5.6, 5.6, 1)], ['', rect(7.2, 7.2, 5.6, 5.6, 1)]],