@code3d/core 0.0.1-alpha.4 → 0.0.1-alpha.6

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.
Files changed (40) hide show
  1. package/README.md +31 -3
  2. package/bld/chunks/{chunk-OQLJDJIF.js → chunk-3RIMOCPP.js} +2 -2
  3. package/bld/chunks/{chunk-PAIFBNU4.js → chunk-KYW4AWKO.js} +2 -2
  4. package/bld/chunks/{chunk-J77FMYFY.js → chunk-T3RAUNSF.js} +941 -514
  5. package/bld/chunks/chunk-T3RAUNSF.js.map +7 -0
  6. package/bld/chunks/{chunk-ZMT6EFHL.js → chunk-T6COR2SG.js} +3 -3
  7. package/bld/library/bound-solver.d.ts +29 -5
  8. package/bld/library/bound-solver.d.ts.map +1 -1
  9. package/bld/library/index.d.ts +2 -2
  10. package/bld/library/index.d.ts.map +1 -1
  11. package/bld/library/index.js +15 -1
  12. package/bld/library/kernel-cache.d.ts +2 -1
  13. package/bld/library/kernel-cache.d.ts.map +1 -1
  14. package/bld/library/relation-solver.d.ts +12 -7
  15. package/bld/library/relation-solver.d.ts.map +1 -1
  16. package/bld/library/replicad.js +2 -2
  17. package/bld/library/runtime.d.ts +214 -78
  18. package/bld/library/runtime.d.ts.map +1 -1
  19. package/bld/library/sketch.d.ts +2 -2
  20. package/bld/library/sketch.d.ts.map +1 -1
  21. package/bld/library/topology.d.ts +2 -0
  22. package/bld/library/topology.d.ts.map +1 -1
  23. package/bld/node/index.js +17 -3
  24. package/bld/node/replicad.js +4 -4
  25. package/bld/tooling/index.d.ts +3 -3
  26. package/bld/tooling/index.d.ts.map +1 -1
  27. package/bld/tooling/index.js +16 -10
  28. package/package.json +1 -1
  29. package/src/library/bound-solver.ts +103 -73
  30. package/src/library/index.ts +13 -2
  31. package/src/library/kernel-cache.ts +8 -0
  32. package/src/library/relation-solver.ts +194 -110
  33. package/src/library/runtime.ts +1029 -436
  34. package/src/library/sketch.ts +3 -3
  35. package/src/library/topology.ts +13 -2
  36. package/src/tooling/index.ts +14 -7
  37. package/bld/chunks/chunk-J77FMYFY.js.map +0 -7
  38. /package/bld/chunks/{chunk-OQLJDJIF.js.map → chunk-3RIMOCPP.js.map} +0 -0
  39. /package/bld/chunks/{chunk-PAIFBNU4.js.map → chunk-KYW4AWKO.js.map} +0 -0
  40. /package/bld/chunks/{chunk-ZMT6EFHL.js.map → chunk-T6COR2SG.js.map} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  SketchFrame,
10
10
  disposeModelObjects,
11
11
  isModelObject,
12
- type Constraint,
12
+ type Relation,
13
13
  type FaceAnchor,
14
14
  type FaceModel,
15
15
  } from './runtime.js';
@@ -90,7 +90,7 @@ export interface Sketch {
90
90
  /** The unbounded local XZ plane (+Y normal), independent of closed regions. */
91
91
  readonly plane: FaceAnchor;
92
92
  /** Relates this immutable sketch's frame without changing its two-dimensional data. */
93
- relate(build: (self: Sketch) => Constraint | readonly Constraint[]): Sketch;
93
+ relate(build: (self: Sketch) => Relation | readonly Relation[]): Sketch;
94
94
  /** References a point defined in this layer. */
95
95
  point(id: number): SketchPoint;
96
96
  /** Adds a local layer while retaining the upstream sketch as read-only input. */
@@ -375,7 +375,7 @@ class SketchValue implements Sketch {
375
375
  return this.frame.plane;
376
376
  }
377
377
 
378
- relate(build: (self: Sketch) => Constraint | readonly Constraint[]): Sketch {
378
+ relate(build: (self: Sketch) => Relation | readonly Relation[]): Sketch {
379
379
  let related!: SketchValue;
380
380
  this.frame.relate(frame => {
381
381
  related = new SketchValue({source: this, frame});
@@ -172,6 +172,7 @@ type StableEdgeGroup = Readonly<{
172
172
  start: number;
173
173
  count: number;
174
174
  edgeId: EdgeId;
175
+ linear: boolean;
175
176
  }>;
176
177
 
177
178
  type StableSurfaceGroup = Readonly<{
@@ -305,7 +306,17 @@ export function stableEdgeGroups(
305
306
  topology,
306
307
  groups.map(group => group.edgeId),
307
308
  );
308
- return groups.map((group, index) => ({...group, edgeId: ids[index]}));
309
+ const linear = new Map(
310
+ edges.map(edge => [
311
+ edge.hashCode,
312
+ (edge as ReplicadEdge).geomType === 'LINE',
313
+ ]),
314
+ );
315
+ return groups.map((group, index) => ({
316
+ ...group,
317
+ edgeId: ids[index],
318
+ linear: linear.get(group.edgeId) ?? false,
319
+ }));
309
320
  } finally {
310
321
  deleteShapes(edges);
311
322
  }
@@ -594,7 +605,7 @@ function resolveTopologyIndex(
594
605
  return index;
595
606
  }
596
607
 
597
- function assertTopologyId(kind: TopologyKind, id: TopologyId): void {
608
+ export function assertTopologyId(kind: TopologyKind, id: TopologyId): void {
598
609
  if (!isTopologyId(id)) {
599
610
  throw new Error(
600
611
  `${kind[0].toUpperCase()}${kind.slice(1)} IDs must be positive integers or paths of at least two positive integers; received ${JSON.stringify(id)}.`,
@@ -9,6 +9,7 @@ export {installOpenCascade} from '../library/open-cascade.js';
9
9
  export {
10
10
  clearKernelOperationCache,
11
11
  kernelOperationCacheStats,
12
+ setKernelCacheBudget,
12
13
  setKernelArtifactStore,
13
14
  setKernelExternalBytes,
14
15
  } from '../library/kernel-cache.js';
@@ -66,15 +67,17 @@ export {describeOpenCascadeException} from '../library/open-cascade-error.js';
66
67
  export {
67
68
  authoringApi,
68
69
  beginModelEvaluation,
69
- constraintPreview,
70
- constraintTraceReference,
70
+ relationPreview,
71
+ currentRelationSelf,
72
+ relationSelectionPreview,
73
+ relationTraceReference,
71
74
  createModelSnapshotter,
72
75
  disposeModelObjects,
73
76
  executeSnapshotQueryBatch,
74
- instrumentConstraint,
77
+ instrumentRelation,
75
78
  instrumentModelOperation,
76
79
  isConstraint,
77
- isConstraintExpression,
80
+ isRelationExpression,
78
81
  isModelObject,
79
82
  modelElementReference,
80
83
  modelObjectRuntimeInfo,
@@ -87,11 +90,14 @@ export {
87
90
  export type {
88
91
  Constraint,
89
92
  ConstraintAnchorSnapshot,
90
- ConstraintExpression,
91
- ConstraintPreview,
93
+ RelationExpression,
94
+ RelationPreview,
92
95
  ConstraintSnapshot,
93
- ConstraintSpatialReference,
96
+ TransformationSnapshot,
97
+ RelationStageSnapshot,
98
+ RelationSpatialReference,
94
99
  ConstraintTraceReference,
100
+ RelationTraceReference,
95
101
  ElementKind,
96
102
  ElementSnapshot,
97
103
  ModelElementReference,
@@ -109,6 +115,7 @@ export type {
109
115
  ModelParameterDimension,
110
116
  ModelSnapshotObject,
111
117
  ModelSpatialOperation,
118
+ RotationReferenceSnapshot,
112
119
  ModelTopologyReference,
113
120
  ParameterKind,
114
121
  ParameterTarget,