@code3d/core 0.0.1-alpha.3 → 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-U5G2VU2I.js → chunk-3RIMOCPP.js} +2 -2
  3. package/bld/chunks/{chunk-P5VGKAEM.js → chunk-KYW4AWKO.js} +2 -2
  4. package/bld/chunks/{chunk-RPY2WVCB.js → chunk-T3RAUNSF.js} +941 -506
  5. package/bld/chunks/chunk-T3RAUNSF.js.map +7 -0
  6. package/bld/chunks/{chunk-BF55AIEQ.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 -76
  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 -424
  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-RPY2WVCB.js.map +0 -7
  38. /package/bld/chunks/{chunk-U5G2VU2I.js.map → chunk-3RIMOCPP.js.map} +0 -0
  39. /package/bld/chunks/{chunk-P5VGKAEM.js.map → chunk-KYW4AWKO.js.map} +0 -0
  40. /package/bld/chunks/{chunk-BF55AIEQ.js.map → chunk-T6COR2SG.js.map} +0 -0
package/README.md CHANGED
@@ -4,6 +4,12 @@ The TypeScript modeling runtime used by Code3D. Compose solids, profiles, curves
4
4
  points, and editable sketches; inspect their geometry and reuse the same models
5
5
  in the App or a supported Node.js runtime.
6
6
 
7
+ Model constructors define the initial origin; derived operations inherit their main
8
+ input frame. `group`, `union`, and `intersect` use the first member or operand,
9
+ `cut` uses the stock, and `loft` uses the first section. See the
10
+ [default origin rules](../web/src/content/docs/docs/concepts/local-coordinates.md#default-origin-rules)
11
+ for all constructors and explicit origin operations.
12
+
7
13
  ## Start with a model
8
14
 
9
15
  ```sh
@@ -43,6 +49,28 @@ angles use degrees. Read [local coordinates](../web/src/content/docs/docs/concep
43
49
  and [relations](../web/src/content/docs/docs/guides/relations.mdx) before mixing
44
50
  origin changes, alignment, and rotation.
45
51
 
52
+ Constraints express `on` and `align` only. Put relative `offset` and `rotate`
53
+ transformations in the `relate` array after the constraints. Zero values add no
54
+ centering or orientation condition; use point or axis alignment to center a part.
55
+ The App's gizmos edit or insert independent array entries.
56
+
57
+ Choose a
58
+ center with `pivot([x,y,z])`, self topology with `pivotVertex(id)`/`axisEdge(id)`,
59
+ or references with `pivotPoint(pointRef)`/`axisLine(lineRef)`; finish each selector
60
+ with `rotate`. Point rotations retain self XYZ axes, including external centers. Consecutive constraints solve jointly; transformations
61
+ then act on that result in order. A later constraint starts a new segment using
62
+ the preceding pose. Independent offsets use fixed composition axes, and rotations
63
+ default to self's current origin. Each completed transformation is one array item,
64
+ for example `[offset(0, 8, 0), rotate(0, 25, 0)]`. Only pivot/axis selections
65
+ chain into `rotate`; completed transformations cannot chain into another operation.
66
+ Keep a selected reference while moving it with
67
+ `pivotVertex(id).pivotOffset(dx, dy, dz).rotate(x, y, z)` or
68
+ `axisLine(axis).axisOffset(dx, dy, dz).rotate(angle)`. Point offsets use self local
69
+ axes; axis offsets use the selected axis frame and preserve its direction.
70
+ Each selector accepts one matching offset, followed by `rotate`.
71
+ See the [transformation example](../app/examples/constraints/transformations.ts)
72
+ and [placement guide](../web/src/content/docs/docs/guides/relations.mdx#transform-a-joint-result).
73
+
46
74
  Build readable models from named intermediate values and public operations. A
47
75
  profile followed by extrusion, or solids combined with Boolean operations,
48
76
  keeps the construction understandable and editable by both people and agents.
@@ -65,7 +93,7 @@ Dimension-based primitives and numeric modeling methods retain required TypeScri
65
93
  signatures while providing runtime defaults for omitted or `undefined` values.
66
94
  Rotations and displacements default to zero, scaling to one, extrusion distance
67
95
  to ten, and fillet radius, chamfer distance and shell thickness to one. Relation
68
- rotation chains use the same angle defaults; `pivot()` defaults to local zero.
96
+ rotation selectors use the same angle defaults; `pivot()` defaults to local zero.
69
97
  Explicit invalid values retain their normal errors. These defaults work in
70
98
  ordinary JavaScript execution as well as App previews.
71
99
 
@@ -142,7 +170,7 @@ const draft = sketch().relate(s => s.plane.align(host.surface(2)));
142
170
  ```
143
171
 
144
172
  The target may be a named plane or a planar `host.surface(id)`. The sketch plane
145
- normal is local `+Y`; alignment uses the same directed-plane, target-frame offset
173
+ normal is local `+Y`; alignment uses the same directed-plane alignment, composition-axis offset
146
174
  and rotation semantics as model relations. It does not implicitly center the
147
175
  sketch on a trimmed surface. An unbounded sketch plane cannot use `on()` to place
148
176
  finite geometry against a bound; use `align()`. Topology-only pivots such as
@@ -162,7 +190,7 @@ of that geometry are not separate authoring definitions. Context outlines are
162
190
  visual references only, not snapping targets or imported geometry constraints.
163
191
  The select-surface-and-create UI is tracked separately within
164
192
  [#114](https://github.com/vilicvane/code3d/issues/114).
165
- Try [sketch-on-surface.ts](../app/examples/sketch-on-surface.ts).
193
+ Try [mounting-plate.ts](../app/examples/sketches/mounting-plate.ts).
166
194
 
167
195
  ## Cached computations and custom primitives
168
196
 
@@ -2,7 +2,7 @@ import {
2
2
  __name,
3
3
  clearKernelOperationCache,
4
4
  setKernelNativeMemoryCounter
5
- } from "./chunk-RPY2WVCB.js";
5
+ } from "./chunk-T3RAUNSF.js";
6
6
 
7
7
  // packages/core/src/library/open-cascade.ts
8
8
  import { setOC } from "replicad";
@@ -16,4 +16,4 @@ __name(installOpenCascade, "installOpenCascade");
16
16
  export {
17
17
  installOpenCascade
18
18
  };
19
- //# sourceMappingURL=chunk-U5G2VU2I.js.map
19
+ //# sourceMappingURL=chunk-3RIMOCPP.js.map
@@ -2,7 +2,7 @@ import {
2
2
  __name,
3
3
  castOwnedShape,
4
4
  primitiveConstructor
5
- } from "./chunk-RPY2WVCB.js";
5
+ } from "./chunk-T3RAUNSF.js";
6
6
 
7
7
  // packages/core/src/library/replicad.ts
8
8
  import * as replicadModule from "replicad";
@@ -27,4 +27,4 @@ export {
27
27
  replicad,
28
28
  definePrimitive
29
29
  };
30
- //# sourceMappingURL=chunk-P5VGKAEM.js.map
30
+ //# sourceMappingURL=chunk-KYW4AWKO.js.map