Skip to content

Commit c96e6d4

Browse files
authored
feat(modeling): V2 api compatibility shim
1 parent 9a1aa7a commit c96e6d4

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

packages/modeling/src/index.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,44 @@ export * from './operations/hulls/index.js'
1313
export * from './operations/modifiers/index.js'
1414
export * from './operations/offsets/index.js'
1515
export * from './operations/transforms/index.js'
16+
17+
// V2 API compatibility:
18+
export * as colors from './colors/index.js'
19+
export * as curves from './curves/index.js'
20+
import { geom2, geom3, path2, poly2, poly3 } from './geometries/index.js'
21+
export const geometries = {
22+
geom2: {
23+
...geom2,
24+
create: (sides) => geom2.fromSides(sides),
25+
fromPoints: (points) => geometries.geom2.create([points])
26+
},
27+
geom3,
28+
path2,
29+
poly2,
30+
poly3: {
31+
...poly3,
32+
fromPoints: (points) => poly3.create([points]),
33+
fromPointsAndPlane: poly3.fromVerticesAndPlane,
34+
toPoints: poly3.toVertices,
35+
},
36+
}
37+
export * as maths from './maths/index.js'
38+
export * as measurements from './measurements/index.js'
39+
export * as primitives from './primitives/index.js'
40+
export * as text from './text/index.js'
41+
export * as booleans from './operations/booleans/index.js'
42+
import * as extrusion from './operations/extrusions/index.js'
43+
export const extrusions = {
44+
...extrusion,
45+
extrudeRectangular: (opt, geom) => extrusions.extrudeLinear(opt, offsets.offset(opt, geom)),
46+
slice: geometries.slice,
47+
}
48+
export * as hulls from './operations/hulls/index.js'
49+
export * as modifiers from './operations/modifiers/index.js'
50+
import * as offsets from './operations/offsets/index.js'
51+
export const expansions = {
52+
...offsets,
53+
expand: offsets.offset,
54+
}
55+
export * as transforms from './operations/transforms/index.js'
56+
export * as utils from './utils/index.js'

0 commit comments

Comments
 (0)