@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.
- package/README.md +55 -41
- package/bld/chunks/{chunk-HZRQUHM2.js → chunk-776Q5P2L.js} +2 -2
- package/bld/chunks/{chunk-QK6ZET47.js → chunk-N7JJWNVL.js} +3 -3
- package/bld/chunks/{chunk-CL3E2DE4.js → chunk-VFPWXSFD.js} +2 -2
- package/bld/chunks/{chunk-JBVIAMJ6.js → chunk-VINZNODV.js} +589 -26
- package/bld/chunks/chunk-VINZNODV.js.map +7 -0
- package/bld/library/extrude.d.ts +5 -0
- package/bld/library/extrude.d.ts.map +1 -1
- package/bld/library/index.d.ts +2 -2
- package/bld/library/index.d.ts.map +1 -1
- package/bld/library/index.js +17 -1
- package/bld/library/inspect.d.ts +3 -1
- package/bld/library/inspect.d.ts.map +1 -1
- package/bld/library/loft.d.ts +7 -1
- package/bld/library/loft.d.ts.map +1 -1
- package/bld/library/replicad.js +2 -2
- package/bld/library/runtime.d.ts +75 -8
- package/bld/library/runtime.d.ts.map +1 -1
- package/bld/node/index.js +19 -3
- package/bld/node/replicad.js +4 -4
- package/bld/tooling/index.js +2 -2
- package/docs/api.md +143 -13
- package/docs/local-coordinates.md +2 -0
- package/docs/runtime.md +52 -2
- package/docs/topology.md +6 -0
- package/docs/values.md +34 -31
- package/package.json +1 -1
- package/src/library/extrude.ts +129 -2
- package/src/library/index.ts +9 -0
- package/src/library/inspect.ts +4 -2
- package/src/library/loft.ts +67 -2
- package/src/library/runtime.ts +646 -8
- package/bld/chunks/chunk-JBVIAMJ6.js.map +0 -7
- /package/bld/chunks/{chunk-HZRQUHM2.js.map → chunk-776Q5P2L.js.map} +0 -0
- /package/bld/chunks/{chunk-QK6ZET47.js.map → chunk-N7JJWNVL.js.map} +0 -0
- /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
|
-
|
|
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,
|
|
22
|
+
import {box, group, offset, pivot} from '@code3d/core';
|
|
21
23
|
|
|
22
|
-
const base = box(40,
|
|
23
|
-
const
|
|
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,
|
|
31
|
+
export default group([base, part]);
|
|
26
32
|
```
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[
|
|
34
|
+

|
|
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
|
-
|
|
60
|
-
[
|
|
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-
|
|
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-
|
|
30
|
+
//# sourceMappingURL=chunk-776Q5P2L.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installOpenCascade
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VFPWXSFD.js";
|
|
4
4
|
import {
|
|
5
5
|
__name,
|
|
6
6
|
installFontEngine,
|
|
7
7
|
installModelResourceReader,
|
|
8
8
|
installSketchSolver
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
31
|
+
//# sourceMappingURL=chunk-N7JJWNVL.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__name,
|
|
3
3
|
clearKernelOperationCache,
|
|
4
4
|
setKernelNativeMemoryCounter
|
|
5
|
-
} from "./chunk-
|
|
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-
|
|
19
|
+
//# sourceMappingURL=chunk-VFPWXSFD.js.map
|