Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(modeling): V2 api compatibility shim #1323

Open
wants to merge 1 commit into
base: V3
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions packages/modeling/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,44 @@ export * from './operations/hulls/index.js'
export * from './operations/modifiers/index.js'
export * from './operations/offsets/index.js'
export * from './operations/transforms/index.js'

// V2 API compatibility:
export * as colors from './colors/index.js'
export * as curves from './curves/index.js'
import { geom2, geom3, path2, poly2, poly3 } from './geometries/index.js'
export const geometries = {
geom2: {
...geom2,
create: (sides) => geom2.fromSides(sides),
fromPoints: (points) => geometries.geom2.create([points])
},
geom3,
path2,
poly2,
poly3: {
...poly3,
fromPoints: (points) => poly3.create([points]),
fromPointsAndPlane: poly3.fromVerticesAndPlane,
toPoints: poly3.toVertices,
},
}
export * as maths from './maths/index.js'
export * as measurements from './measurements/index.js'
export * as primitives from './primitives/index.js'
export * as text from './text/index.js'
export * as booleans from './operations/booleans/index.js'
import * as extrusion from './operations/extrusions/index.js'
export const extrusions = {
...extrusion,
extrudeRectangular: (opt, geom) => extrusions.extrudeLinear(opt, offsets.offset(opt, geom)),
slice: geometries.slice,
}
export * as hulls from './operations/hulls/index.js'
export * as modifiers from './operations/modifiers/index.js'
import * as offsets from './operations/offsets/index.js'
export const expansions = {
...offsets,
expand: offsets.offset,
}
export * as transforms from './operations/transforms/index.js'
export * as utils from './utils/index.js'
Loading