@code3d/core 0.0.1-alpha.11 → 0.0.1-alpha.13

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 (36) hide show
  1. package/README.md +55 -41
  2. package/bld/chunks/{chunk-HZRQUHM2.js → chunk-776Q5P2L.js} +2 -2
  3. package/bld/chunks/{chunk-QK6ZET47.js → chunk-N7JJWNVL.js} +3 -3
  4. package/bld/chunks/{chunk-CL3E2DE4.js → chunk-VFPWXSFD.js} +2 -2
  5. package/bld/chunks/{chunk-JBVIAMJ6.js → chunk-VINZNODV.js} +589 -26
  6. package/bld/chunks/chunk-VINZNODV.js.map +7 -0
  7. package/bld/library/extrude.d.ts +5 -0
  8. package/bld/library/extrude.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 +17 -1
  12. package/bld/library/inspect.d.ts +3 -1
  13. package/bld/library/inspect.d.ts.map +1 -1
  14. package/bld/library/loft.d.ts +7 -1
  15. package/bld/library/loft.d.ts.map +1 -1
  16. package/bld/library/replicad.js +2 -2
  17. package/bld/library/runtime.d.ts +75 -8
  18. package/bld/library/runtime.d.ts.map +1 -1
  19. package/bld/node/index.js +19 -3
  20. package/bld/node/replicad.js +4 -4
  21. package/bld/tooling/index.js +2 -2
  22. package/docs/api.md +143 -13
  23. package/docs/local-coordinates.md +2 -0
  24. package/docs/runtime.md +52 -2
  25. package/docs/topology.md +6 -0
  26. package/docs/values.md +34 -31
  27. package/package.json +1 -1
  28. package/src/library/extrude.ts +129 -2
  29. package/src/library/index.ts +9 -0
  30. package/src/library/inspect.ts +4 -2
  31. package/src/library/loft.ts +67 -2
  32. package/src/library/runtime.ts +646 -8
  33. package/bld/chunks/chunk-JBVIAMJ6.js.map +0 -7
  34. /package/bld/chunks/{chunk-HZRQUHM2.js.map → chunk-776Q5P2L.js.map} +0 -0
  35. /package/bld/chunks/{chunk-QK6ZET47.js.map → chunk-N7JJWNVL.js.map} +0 -0
  36. /package/bld/chunks/{chunk-CL3E2DE4.js.map → chunk-VFPWXSFD.js.map} +0 -0
package/README.md CHANGED
@@ -4,57 +4,71 @@ 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](docs/local-coordinates.md#default-origin-rules)
11
- for all constructors and explicit origin operations.
12
-
13
- ## Start with a model
7
+ ## Installation
14
8
 
15
9
  ```sh
16
10
  npm install @code3d/core
17
11
  ```
18
12
 
13
+ The App includes Core in its built-in modeling runtime. If a project declares
14
+ its own `@code3d/core`, the App uses that project's installed packages
15
+ and declarations instead. See [project package installation](../web/src/content/docs/docs/getting-started/files.md#install-packages-in-browser-storage).
16
+
17
+ ## Example
18
+
19
+ Place a part on a base, offset it, and rotate it around a chosen pivot.
20
+
19
21
  ```ts
20
- import {box, cylinder, group} from '@code3d/core';
22
+ import {box, group, offset, pivot} from '@code3d/core';
21
23
 
22
- const base = box(40, 4, 24).fillet(1);
23
- const post = cylinder(3, 18).relate(self => self.on(base.up));
24
+ const base = box(40, 8, 30);
25
+ const part = box(14, 20, 12).relate(self => [
26
+ self.on(base.up), // Touch the base.
27
+ offset(6, 0, 0),
28
+ pivot([0, -10, 0]).rotate(0, 0, 25),
29
+ ]);
24
30
 
25
- export default group([base, post]);
31
+ export default group([base, part]);
26
32
  ```
27
33
 
28
- Open this source in Code3D and select an expression to inspect its value. Node
29
- loads the modeling kernel through the package's Node entry automatically; normal
30
- model authors do not initialize it or manage evaluation caches themselves.
31
-
32
- The App includes Core, [Materials](../materials/README.md), and
33
- [Screws](../screws/README.md) for zero-install projects. When the active model's
34
- package scope or an ancestor `package.json` declares `@code3d/core`, the App uses that project's installed
35
- packages and declarations exclusively. Missing dependencies are errors. See
36
- [project package installation](../web/src/content/docs/docs/getting-started/files.md#install-packages-in-browser-storage)
37
- and the [agent file workflow](../../docs/agents/files.md).
38
-
39
- ## Find the modeling API
40
-
41
- | Task | Start here |
42
- | ------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
43
- | Solids, planar profiles, curves, points, Boolean operations, extrusion and loft | [Modeling reference](docs/api.md) |
44
- | Place parts with bounds, align geometry or match coordinate frames | [Relations](docs/relations.mdx) |
45
- | Change origins and rotate parts | [Origins and rotation](docs/origins-and-rotation.mdx) |
46
- | Hollow a solid or choose openings | [Shells](docs/shells.mdx) |
47
- | Select vertices, edges and surfaces, or expose named elements | [Topology](docs/topology.md) |
48
- | Build reusable model functions | [Reusable models](../web/src/content/docs/docs/guides/reusable-models.mdx) |
49
- | Give functions editing tools and example arguments | [Model tools](../web/src/content/docs/docs/guides/model-tools.mdx) |
50
- | Customize parameter and call inspection | [Source inspection](docs/runtime.md#source-inspection) |
51
- | Extend the runtime with Replicad geometry | [Custom primitives](docs/custom-primitives.mdx) |
52
- | Known boundaries | [Current limitations](../web/src/content/docs/docs/getting-started/limitations.md) |
53
-
54
- See also [model values and measurements](docs/values.md), [editable sketches](docs/sketches.md),
55
- [text and fonts](docs/text.md), and [runtime integration](docs/runtime.md).
34
+ ![The relation example in the App, with a rotation gizmo on the tilted part and its rotation parameter panel open.](../web/src/assets/models/core-relate-tools.png)
35
+
36
+ The part is rotated 25° around Z. In the App, select `rotate(0, 0, 25)` to show
37
+ the rotation gizmo and parameter panel. Drag a ring or edit an angle to update
38
+ the code.
39
+
40
+ Complete example: [part placement and rotation](../app/examples/constraints/relate.ts).
41
+
42
+ ## Usage notes
43
+
44
+ - Dimensions are in millimetres and angles are in degrees.
45
+ - Models have local coordinate frames. Constructors choose the initial origin;
46
+ derived operations inherit their main input frame. See [local coordinates](docs/local-coordinates.md).
47
+ - Modeling operations return new values. Measurements such as `.length`, `.area`
48
+ and `.volume` return numbers; select an expression in the App to inspect it.
49
+ - Node loads the modeling kernel automatically. Model authors do not initialize
50
+ it or manage evaluation caches. See [runtime integration](docs/runtime.md).
51
+
52
+ ## Documentation
53
+
54
+ - [Modeling API](docs/api.md): primitives, operations, materials and measurements.
55
+ - [Model values](docs/values.md): immutable values and geometry measurements.
56
+ - [Local coordinates](docs/local-coordinates.md): frames, origins and placement conventions.
57
+ - [Relations](docs/relations.mdx): position parts using bounds, geometry and frames.
58
+ - [Origins and rotation](docs/origins-and-rotation.mdx): choose a pivot and adjust a part.
59
+ - [Shells](docs/shells.mdx): hollow solids and choose openings.
60
+ - [Topology](docs/topology.md): select vertices, edges and faces and expose named elements.
61
+ - [Editable sketches](docs/sketches.md): draw and constrain planar geometry.
62
+ - [Text and fonts](docs/text.md): build geometry from text.
63
+ - [Reusable models](../web/src/content/docs/docs/guides/reusable-models.mdx): compose model functions.
64
+ - [Model tools](../web/src/content/docs/docs/guides/model-tools.mdx): add editing tools and argument presets.
65
+ - [Custom primitives](docs/custom-primitives.mdx): extend modeling with Replicad geometry.
66
+ - [Runtime integration](docs/runtime.md): resources, materials and source inspection.
67
+ - [Current limitations](../web/src/content/docs/docs/getting-started/limitations.md): supported workflows and known boundaries.
56
68
 
57
69
  ## Source and development
58
70
 
59
- Start with the [public API](src/library/index.ts), [runtime tests](test/), and
60
- [development and integration notes](docs/runtime.md#source-and-development).
71
+ - [Public API](src/library/index.ts): exported constructors and model interfaces.
72
+ - [Runtime tests](test/): geometry, value semantics and integration coverage.
73
+ - [Runtime development](docs/runtime.md#source-and-development): kernel integration and resource ownership.
74
+ - [Development guide](../../.agents/docs/development.md): repository setup and test commands.
@@ -2,7 +2,7 @@ import {
2
2
  __name,
3
3
  castOwnedShape,
4
4
  primitiveConstructor
5
- } from "./chunk-JBVIAMJ6.js";
5
+ } from "./chunk-VINZNODV.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-HZRQUHM2.js.map
30
+ //# sourceMappingURL=chunk-776Q5P2L.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  installOpenCascade
3
- } from "./chunk-CL3E2DE4.js";
3
+ } from "./chunk-VFPWXSFD.js";
4
4
  import {
5
5
  __name,
6
6
  installFontEngine,
7
7
  installModelResourceReader,
8
8
  installSketchSolver
9
- } from "./chunk-JBVIAMJ6.js";
9
+ } from "./chunk-VINZNODV.js";
10
10
 
11
11
  // packages/core/src/node/index.ts
12
12
  import initOpenCascade from "@code3d/opencascade";
@@ -28,4 +28,4 @@ installSketchSolver(
28
28
  ), "locateFile")
29
29
  })
30
30
  );
31
- //# sourceMappingURL=chunk-QK6ZET47.js.map
31
+ //# sourceMappingURL=chunk-N7JJWNVL.js.map
@@ -2,7 +2,7 @@ import {
2
2
  __name,
3
3
  clearKernelOperationCache,
4
4
  setKernelNativeMemoryCounter
5
- } from "./chunk-JBVIAMJ6.js";
5
+ } from "./chunk-VINZNODV.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-CL3E2DE4.js.map
19
+ //# sourceMappingURL=chunk-VFPWXSFD.js.map