chili3d 0.6.1 → 0.6.3
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 +14 -175
- package/{packages/chili → chili}/package.json +6 -1
- package/{packages/chili-builder → chili-builder}/package.json +6 -1
- package/{packages/chili-controls → chili-controls}/package.json +6 -1
- package/{packages/chili-core → chili-core}/package.json +6 -1
- package/{packages/chili-geo → chili-geo}/package.json +6 -1
- package/{packages/chili-i18n → chili-i18n}/package.json +6 -1
- package/{packages/chili-storage → chili-storage}/package.json +6 -1
- package/{packages/chili-three → chili-three}/package.json +6 -1
- package/{packages/chili-ui → chili-ui}/package.json +6 -1
- package/{packages/chili-vis → chili-vis}/package.json +6 -1
- package/{packages/chili-wasm → chili-wasm}/package.json +6 -1
- package/{packages/chili-web → chili-web}/package.json +6 -1
- package/package.json +18 -48
- package/.github/workflows/main.yml +0 -26
- package/.vscode/c_cpp_properties.json +0 -30
- package/.vscode/launch.json +0 -21
- package/.vscode/settings.json +0 -8
- package/Dockerfile +0 -7
- package/LICENSE +0 -661
- package/biome.json +0 -67
- package/compose.yml +0 -7
- package/cpp/CMakeLists.txt +0 -96
- package/cpp/CMakePresets.json +0 -43
- package/cpp/README.md +0 -21
- package/cpp/src/converter.cpp +0 -413
- package/cpp/src/factory.cpp +0 -612
- package/cpp/src/geometry.cpp +0 -204
- package/cpp/src/mesher.cpp +0 -330
- package/cpp/src/opencascade.cpp +0 -414
- package/cpp/src/shape.cpp +0 -447
- package/cpp/src/shared.cpp +0 -83
- package/cpp/src/shared.hpp +0 -211
- package/cpp/src/transient.cpp +0 -29
- package/cpp/src/utils.cpp +0 -114
- package/cpp/src/utils.hpp +0 -25
- package/cpp/test/index.html +0 -146
- package/packages/chili/test/command.test.ts +0 -4
- package/packages/chili-controls/test/converter.test.ts +0 -70
- package/packages/chili-controls/test/styleMock.js +0 -4
- package/packages/chili-core/test/binding.test.ts +0 -95
- package/packages/chili-core/test/boundingBox.test.ts +0 -60
- package/packages/chili-core/test/collection.test.ts +0 -53
- package/packages/chili-core/test/history.test.ts +0 -42
- package/packages/chili-core/test/line.test.ts +0 -75
- package/packages/chili-core/test/linesegment.test.ts +0 -98
- package/packages/chili-core/test/linkedList.test.ts +0 -82
- package/packages/chili-core/test/math.test.ts +0 -34
- package/packages/chili-core/test/matrix.test.ts +0 -129
- package/packages/chili-core/test/node.test.ts +0 -122
- package/packages/chili-core/test/nodeList.test.ts +0 -247
- package/packages/chili-core/test/observer.test.ts +0 -91
- package/packages/chili-core/test/plane.test.ts +0 -31
- package/packages/chili-core/test/quaternion.test.ts +0 -14
- package/packages/chili-core/test/result.test.ts +0 -24
- package/packages/chili-core/test/serializer.test.ts +0 -58
- package/packages/chili-core/test/snapType.test.ts +0 -10
- package/packages/chili-core/test/task.test.ts +0 -41
- package/packages/chili-core/test/testDocument.ts +0 -70
- package/packages/chili-core/test/transaction.test.ts +0 -42
- package/packages/chili-core/test/visual.test.ts +0 -42
- package/packages/chili-core/test/xyz.test.ts +0 -260
- package/packages/chili-three/test/cameraControls.ts +0 -10
- package/packages/chili-three/test/testDocument.ts +0 -68
- package/packages/chili-three/test/testEdge.ts +0 -171
- package/packages/chili-three/test/testView.ts +0 -78
- package/packages/chili-three/test/three.test.ts +0 -44
- package/packages/chili-three/test/viewGizmo.ts +0 -12
- package/packages/global.d.ts +0 -31
- package/public/favicon.svg +0 -10
- package/public/fonts/fzhei.json +0 -46120
- package/public/iconfont.js +0 -1
- package/public/images/wechat.jpg +0 -0
- package/public/index.css +0 -13
- package/public/index.html +0 -24
- package/rspack.config.ts +0 -93
- package/rstest.config.ts +0 -27
- package/screenshots/screenshot.png +0 -0
- package/scripts/add_copyright.mjs +0 -59
- package/scripts/build-npm.mjs +0 -105
- package/scripts/common.mjs +0 -24
- package/scripts/release.mjs +0 -92
- package/scripts/restore-package-json.mjs +0 -27
- package/scripts/setup_wasm_deps.mjs +0 -97
- package/scripts/update-package-json.mjs +0 -27
- package/tsconfig.build.json +0 -14
- package/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.json +0 -19
- /package/{packages/chili → chili}/src/application.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/arc.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/boolean.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/box.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/circle.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/cone.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/cylinder.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/ellipse.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/face.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/fuse.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/index.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/line.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/polygon.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/prism.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/pyramid.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/rect.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/revolve.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/sphere.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/sweep.ts +0 -0
- /package/{packages/chili → chili}/src/bodys/wire.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/index.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/newDocument.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/openDocument.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/performanceTest.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/saveDocument.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/toFile.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/toggleDynamicWorkplane.ts +0 -0
- /package/{packages/chili → chili}/src/commands/application/wechatGroup.ts +0 -0
- /package/{packages/chili → chili}/src/commands/boolean.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/arc.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/bezier.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/box.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/circle.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/cone.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/converter.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/copySubShape.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/curveProjection.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/cylinder.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/ellipse.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/group.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/index.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/line.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/loft.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/offset.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/polygon.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/prism.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/pyramid.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/rect.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/revolve.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/section.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/sphere.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/sweep.ts +0 -0
- /package/{packages/chili → chili}/src/commands/create/thickSolid.ts +0 -0
- /package/{packages/chili → chili}/src/commands/createActCommand.ts +0 -0
- /package/{packages/chili → chili}/src/commands/createCommand.ts +0 -0
- /package/{packages/chili → chili}/src/commands/delete.ts +0 -0
- /package/{packages/chili → chili}/src/commands/folder.ts +0 -0
- /package/{packages/chili → chili}/src/commands/importExport.ts +0 -0
- /package/{packages/chili → chili}/src/commands/index.ts +0 -0
- /package/{packages/chili → chili}/src/commands/measure/angle.ts +0 -0
- /package/{packages/chili → chili}/src/commands/measure/index.ts +0 -0
- /package/{packages/chili → chili}/src/commands/measure/length.ts +0 -0
- /package/{packages/chili → chili}/src/commands/measure/select.module.css +0 -0
- /package/{packages/chili → chili}/src/commands/measure/select.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/array.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/break.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/brush.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/chamfer.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/explode.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/fillet.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/index.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/mirror.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/move.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/removeFeature.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/removeSubShapes.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/rotate.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/split.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/transformedCommand.ts +0 -0
- /package/{packages/chili → chili}/src/commands/modify/trim.ts +0 -0
- /package/{packages/chili → chili}/src/commands/multistepCommand.ts +0 -0
- /package/{packages/chili → chili}/src/commands/redo.ts +0 -0
- /package/{packages/chili → chili}/src/commands/undo.ts +0 -0
- /package/{packages/chili → chili}/src/commands/workingPlane.ts +0 -0
- /package/{packages/chili → chili}/src/comparers/NumberEqualityComparer.ts +0 -0
- /package/{packages/chili → chili}/src/comparers/XYZEqualityComparer.ts +0 -0
- /package/{packages/chili → chili}/src/comparers/index.ts +0 -0
- /package/{packages/chili → chili}/src/document.ts +0 -0
- /package/{packages/chili → chili}/src/editEventHandler.ts +0 -0
- /package/{packages/chili → chili}/src/index.ts +0 -0
- /package/{packages/chili → chili}/src/selection.ts +0 -0
- /package/{packages/chili → chili}/src/services/commandService.ts +0 -0
- /package/{packages/chili → chili}/src/services/editorService.ts +0 -0
- /package/{packages/chili → chili}/src/services/hotkeyService.ts +0 -0
- /package/{packages/chili → chili}/src/services/index.ts +0 -0
- /package/{packages/chili → chili}/src/snap/dimension.ts +0 -0
- /package/{packages/chili → chili}/src/snap/handlers/angleSnapEventHandler.ts +0 -0
- /package/{packages/chili → chili}/src/snap/handlers/index.ts +0 -0
- /package/{packages/chili → chili}/src/snap/handlers/lengthSnapEventHandler.ts +0 -0
- /package/{packages/chili → chili}/src/snap/handlers/pointSnapEventHandler.ts +0 -0
- /package/{packages/chili → chili}/src/snap/handlers/snapEventHandler.ts +0 -0
- /package/{packages/chili → chili}/src/snap/index.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snap.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/axisSnap.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/baseSnap.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/featurePointStrategy.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/index.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/objectSnap.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/planeSnap.ts +0 -0
- /package/{packages/chili → chili}/src/snap/snaps/pointOnCurveSnap.ts +0 -0
- /package/{packages/chili → chili}/src/snap/tracking/axis.ts +0 -0
- /package/{packages/chili → chili}/src/snap/tracking/axisTracking.ts +0 -0
- /package/{packages/chili → chili}/src/snap/tracking/index.ts +0 -0
- /package/{packages/chili → chili}/src/snap/tracking/objectTracking.ts +0 -0
- /package/{packages/chili → chili}/src/snap/tracking/trackingBase.ts +0 -0
- /package/{packages/chili → chili}/src/snap/tracking/trackingSnap.ts +0 -0
- /package/{packages/chili → chili}/src/step/angleStep.ts +0 -0
- /package/{packages/chili → chili}/src/step/index.ts +0 -0
- /package/{packages/chili → chili}/src/step/lengthStep.ts +0 -0
- /package/{packages/chili → chili}/src/step/pointStep.ts +0 -0
- /package/{packages/chili → chili}/src/step/selectStep.ts +0 -0
- /package/{packages/chili → chili}/src/step/step.ts +0 -0
- /package/{packages/chili → chili}/src/utils.ts +0 -0
- /package/{packages/chili-builder → chili-builder}/src/additionalModule.ts +0 -0
- /package/{packages/chili-builder → chili-builder}/src/appBuilder.ts +0 -0
- /package/{packages/chili-builder → chili-builder}/src/defaultDataExchange.ts +0 -0
- /package/{packages/chili-builder → chili-builder}/src/index.ts +0 -0
- /package/{packages/chili-builder → chili-builder}/src/ribbon.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/collection.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/controls.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/converters/colorConverter.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/converters/index.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/converters/numberConverter.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/converters/stringConverter.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/converters/urlConverter.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/converters/xyzConverter.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/expander/expander.module.css +0 -0
- /package/{packages/chili-controls → chili-controls}/src/expander/expander.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/expander/index.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/htmlProps.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/index.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/radioGroup.module.css +0 -0
- /package/{packages/chili-controls → chili-controls}/src/radioGroup.ts +0 -0
- /package/{packages/chili-controls → chili-controls}/src/utils.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/application.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/command/command.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/command/commandKeys.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/command/decarator.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/command/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/config.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/constants.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/dataExchange.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/document.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/editor.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/asyncController.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/binding.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/collection.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/converter.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/deepObserver.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/disposable.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/dto/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/equalityComparer.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/gc.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/history.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/id.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/lazy.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/linkedList.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/logger.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/messageType.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/objectStorage.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/observer.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/precision.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/pubsub.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/result.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/storage.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/transaction.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/utils/debounce.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/utils/download.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/utils/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/foundation/utils/readFileAsync.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/i18n/i18n.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/i18n/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/i18n/keys.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/material.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/boundingBox.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/line.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/lineSegment.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/mathUtils.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/matrix4.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/plane.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/planeAngle.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/quaternion.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/ray.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/xy.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/math/xyz.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/component.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/facebaseNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/folderNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/geometryNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/groupNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/meshNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/node.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/shapeNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/model/visualNode.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/modelManager.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/navigation.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/property.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/selection.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/selectionFilter.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/serialize/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/serialize/serializer.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/service.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/curve.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/geometry.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/lineType.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/meshData.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/shape.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/shapeConverter.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/shapeFactory.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/shapeType.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/shape/surface.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/snapType.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/ui/button.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/ui/combobox.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/ui/dialog.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/ui/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/ui/ribbon.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/ui/window.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/act.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/cameraController.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/cursorType.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/detectedData.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/eventHandler.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/highlighter.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/index.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/meshExporter.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/meshUtils.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/textGenerator.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/view.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/viewGizmo.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/viewport.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/visual.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/visualContext.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/visualFactory.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/visualObject.ts +0 -0
- /package/{packages/chili-core → chili-core}/src/visual/visualShape.ts +0 -0
- /package/{packages/chili-geo → chili-geo}/src/index.ts +0 -0
- /package/{packages/chili-geo → chili-geo}/src/utils.ts +0 -0
- /package/{packages/chili-i18n → chili-i18n}/src/en.ts +0 -0
- /package/{packages/chili-i18n → chili-i18n}/src/index.ts +0 -0
- /package/{packages/chili-i18n → chili-i18n}/src/pt-br.ts +0 -0
- /package/{packages/chili-i18n → chili-i18n}/src/zh-cn.ts +0 -0
- /package/{packages/chili-storage → chili-storage}/src/index.ts +0 -0
- /package/{packages/chili-storage → chili-storage}/src/indexedDBStorage.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/cameraController.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/common.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/constants.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/highlightable.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/index.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/meshExporter.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/outlinePass.js +0 -0
- /package/{packages/chili-three → chili-three}/src/texture_points.jpg +0 -0
- /package/{packages/chili-three → chili-three}/src/threeGeometry.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeGeometryFactory.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeHelper.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeHighlighter.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeView.module.css +0 -0
- /package/{packages/chili-three → chili-three}/src/threeView.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeViewEventHandler.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeVisual.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeVisualContext.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeVisualFactory.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/threeVisualObject.ts +0 -0
- /package/{packages/chili-three → chili-three}/src/viewGizmo.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/cursor/draw.cur +0 -0
- /package/{packages/chili-ui → chili-ui}/src/cursor/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/dialog.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/dialog.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/editor.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/editor.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/home/home.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/home/home.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/home/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/home/languageSelector.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/home/navigation3DSelector.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/home/themeSelector.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/mainWindow.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/mainWindow.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/okCancel.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/okCancel.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/permanent.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/permanent.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/projectView.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/projectView.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/toolBar.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/toolBar.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/tree.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/tree.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItem.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItem.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItemGroup.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/treeItemGroup.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/treeModel.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/project/tree/treeModel.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/check.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/colorPorperty.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/colorProperty.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/common.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/input.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/input.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/material/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/material/materialDataContent.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/material/materialEditor.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/material/materialEditor.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/material/textureEditor.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/material/textureEditor.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/materialProperty.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/materialProperty.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/matrixProperty.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/propertyBase.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/propertyBase.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/propertyView.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/propertyView.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/property/utils.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/commandContext.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/commandContext.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbon.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbon.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonButton.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonButton.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonData.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonStack.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonStack.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonToggleButton.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/ribbon/ribbonToggleButton.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/statusbar/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/statusbar/snapConfig.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/statusbar/snapConfig.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/statusbar/statusbar.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/statusbar/statusbar.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/toast/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/toast/toast.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/toast/toast.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/flyout.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/flyout.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/input.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/input.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/tip.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/flyout/tip.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/index.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/layoutViewport.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/layoutViewport.ts +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/viewport.module.css +0 -0
- /package/{packages/chili-ui → chili-ui}/src/viewport/viewport.ts +0 -0
- /package/{packages/chili-vis → chili-vis}/src/index.ts +0 -0
- /package/{packages/chili-vis → chili-vis}/src/nodeSelectionEventHandler.ts +0 -0
- /package/{packages/chili-vis → chili-vis}/src/selectionEventHandler.ts +0 -0
- /package/{packages/chili-vis → chili-vis}/src/shapeSelectionEventHandler.ts +0 -0
- /package/{packages/chili-vis → chili-vis}/src/viewUtils.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/lib/chili-wasm.d.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/lib/chili-wasm.js +0 -0
- /package/{packages/chili-wasm → chili-wasm}/lib/chili-wasm.wasm +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/converter.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/curve.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/factory.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/geometry.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/helper.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/index.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/mesher.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/shape.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/surface.ts +0 -0
- /package/{packages/chili-wasm → chili-wasm}/src/wasm.ts +0 -0
- /package/{packages/chili-web → chili-web}/src/index.ts +0 -0
- /package/{packages/chili-web → chili-web}/src/loading.ts +0 -0
package/cpp/src/factory.cpp
DELETED
|
@@ -1,612 +0,0 @@
|
|
|
1
|
-
// Part of the Chili3d Project, under the AGPL-3.0 License.
|
|
2
|
-
// See LICENSE file in the project root for full license information.
|
|
3
|
-
|
|
4
|
-
#include <emscripten/bind.h>
|
|
5
|
-
#include <emscripten/val.h>
|
|
6
|
-
|
|
7
|
-
#include "shared.hpp"
|
|
8
|
-
#include "utils.hpp"
|
|
9
|
-
#include <BRepAlgoAPI_BooleanOperation.hxx>
|
|
10
|
-
#include <BRepAlgoAPI_Common.hxx>
|
|
11
|
-
#include <BRepAlgoAPI_Cut.hxx>
|
|
12
|
-
#include <BRepAlgoAPI_Fuse.hxx>
|
|
13
|
-
#include <BRepBuilderAPI_GTransform.hxx>
|
|
14
|
-
#include <BRepBuilderAPI_MakeEdge.hxx>
|
|
15
|
-
#include <BRepBuilderAPI_MakeFace.hxx>
|
|
16
|
-
#include <BRepBuilderAPI_MakePolygon.hxx>
|
|
17
|
-
#include <BRepBuilderAPI_MakeSolid.hxx>
|
|
18
|
-
#include <BRepBuilderAPI_MakeVertex.hxx>
|
|
19
|
-
#include <BRepBuilderAPI_MakeWire.hxx>
|
|
20
|
-
#include <BRepFilletAPI_MakeChamfer.hxx>
|
|
21
|
-
#include <BRepFilletAPI_MakeFillet.hxx>
|
|
22
|
-
#include <BRepOffsetAPI_MakePipe.hxx>
|
|
23
|
-
#include <BRepOffsetAPI_MakePipeShell.hxx>
|
|
24
|
-
#include <BRepOffsetAPI_MakeThickSolid.hxx>
|
|
25
|
-
#include <BRepOffsetAPI_ThruSections.hxx>
|
|
26
|
-
#include <BRepPrimAPI_MakeBox.hxx>
|
|
27
|
-
#include <BRepPrimAPI_MakeCone.hxx>
|
|
28
|
-
#include <BRepPrimAPI_MakeCylinder.hxx>
|
|
29
|
-
#include <BRepPrimAPI_MakePrism.hxx>
|
|
30
|
-
#include <BRepPrimAPI_MakeRevol.hxx>
|
|
31
|
-
#include <BRepPrimAPI_MakeSphere.hxx>
|
|
32
|
-
#include <BRepProj_Projection.hxx>
|
|
33
|
-
#include <Geom_BezierCurve.hxx>
|
|
34
|
-
#include <ShapeAnalysis_Edge.hxx>
|
|
35
|
-
#include <ShapeAnalysis_WireOrder.hxx>
|
|
36
|
-
#include <ShapeUpgrade_UnifySameDomain.hxx>
|
|
37
|
-
#include <TopoDS.hxx>
|
|
38
|
-
#include <TopoDS_Shape.hxx>
|
|
39
|
-
#include <gp_Ax2.hxx>
|
|
40
|
-
#include <gp_Circ.hxx>
|
|
41
|
-
|
|
42
|
-
using namespace emscripten;
|
|
43
|
-
|
|
44
|
-
struct ShapeResult {
|
|
45
|
-
TopoDS_Shape shape;
|
|
46
|
-
bool isOk;
|
|
47
|
-
std::string error;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
class ShapeFactory {
|
|
51
|
-
public:
|
|
52
|
-
static ShapeResult box(const Pln& ax3, double x, double y, double z)
|
|
53
|
-
{
|
|
54
|
-
gp_Pln pln = Pln::toPln(ax3);
|
|
55
|
-
BRepBuilderAPI_MakeFace makeFace(pln, 0, x, 0, y);
|
|
56
|
-
if (!makeFace.IsDone()) {
|
|
57
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create box" };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
gp_Vec vec(pln.Axis().Direction());
|
|
61
|
-
vec.Multiply(z);
|
|
62
|
-
BRepPrimAPI_MakePrism box(makeFace.Face(), vec);
|
|
63
|
-
if (!box.IsDone()) {
|
|
64
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create box" };
|
|
65
|
-
}
|
|
66
|
-
return ShapeResult { box.Shape(), true, "" };
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
static ShapeResult cone(const Vector3& normal, const Vector3& center, double radius, double radiusUp, double height)
|
|
70
|
-
{
|
|
71
|
-
gp_Ax2 ax2(Vector3::toPnt(center), Vector3::toDir(normal));
|
|
72
|
-
TopoDS_Shape cone = BRepPrimAPI_MakeCone(ax2, radius, radiusUp, height).Shape();
|
|
73
|
-
return ShapeResult { cone, true, "" };
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
static ShapeResult sphere(const Vector3& center, double radius)
|
|
77
|
-
{
|
|
78
|
-
TopoDS_Shape sphere = BRepPrimAPI_MakeSphere(Vector3::toPnt(center), radius).Shape();
|
|
79
|
-
return ShapeResult { sphere, true, "" };
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
static ShapeResult ellipse(const Vector3& normal, const Vector3& center, const Vector3& xvec, double majorRadius,
|
|
83
|
-
double minorRadius)
|
|
84
|
-
{
|
|
85
|
-
gp_Ax2 ax2(Vector3::toPnt(center), Vector3::toDir(normal), Vector3::toDir(xvec));
|
|
86
|
-
gp_Elips ellipse(ax2, majorRadius, minorRadius);
|
|
87
|
-
BRepBuilderAPI_MakeEdge edge(ellipse);
|
|
88
|
-
if (!edge.IsDone()) {
|
|
89
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create ellipse" };
|
|
90
|
-
}
|
|
91
|
-
return ShapeResult { edge.Edge(), true, "" };
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* TODO
|
|
96
|
-
*/
|
|
97
|
-
static ShapeResult ellipsoid(const Vector3& normal, const Vector3& center, const Vector3& xvec, double xRadius,
|
|
98
|
-
double yRadius, double zRadius)
|
|
99
|
-
{
|
|
100
|
-
TopoDS_Shape sphere = BRepPrimAPI_MakeSphere(1).Solid();
|
|
101
|
-
|
|
102
|
-
gp_GTrsf transform;
|
|
103
|
-
transform.SetValue(1, 1, xRadius);
|
|
104
|
-
transform.SetValue(2, 2, yRadius);
|
|
105
|
-
transform.SetValue(3, 3, zRadius);
|
|
106
|
-
transform.SetTranslationPart(gp_XYZ(center.x, center.y, center.z));
|
|
107
|
-
|
|
108
|
-
BRepBuilderAPI_GTransform builder(sphere, transform);
|
|
109
|
-
if (builder.IsDone()) {
|
|
110
|
-
TopoDS_Shape ellipsoid = builder.Shape();
|
|
111
|
-
return ShapeResult { ellipsoid, true, "" };
|
|
112
|
-
}
|
|
113
|
-
return ShapeResult { TopoDS_Shape(), false, "" };
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static ShapeResult pyramid(const Pln& ax3, double x, double y, double z)
|
|
117
|
-
{
|
|
118
|
-
if (abs(x) <= Precision::Confusion() || abs(y) <= Precision::Confusion() || abs(z) <= Precision::Confusion()) {
|
|
119
|
-
return ShapeResult { TopoDS_Shape(), false, "Invalid dimensions" };
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
gp_Pln pln = Pln::toPln(ax3);
|
|
123
|
-
auto xvec = gp_Vec(pln.XAxis().Direction()).Multiplied(x);
|
|
124
|
-
auto yvec = gp_Vec(pln.YAxis().Direction()).Multiplied(y);
|
|
125
|
-
auto zvec = gp_Vec(pln.Axis().Direction()).Multiplied(z);
|
|
126
|
-
auto p1 = pln.Location();
|
|
127
|
-
auto p2 = p1.Translated(xvec);
|
|
128
|
-
auto p3 = p1.Translated(xvec).Translated(yvec);
|
|
129
|
-
auto p4 = p1.Translated(yvec);
|
|
130
|
-
auto top = pln.Location().Translated((xvec + yvec) * 0.5 + zvec);
|
|
131
|
-
|
|
132
|
-
std::vector<TopoDS_Face> faces = {
|
|
133
|
-
TopoDS::Face(pointsToFace({ p1, p2, p3, p4, p1 }).shape), TopoDS::Face(pointsToFace({ p1, p2, top, p1 }).shape),
|
|
134
|
-
TopoDS::Face(pointsToFace({ p2, p3, top, p2 }).shape), TopoDS::Face(pointsToFace({ p3, p4, top, p3 }).shape),
|
|
135
|
-
TopoDS::Face(pointsToFace({ p4, p1, top, p4 }).shape)
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
return facesToSolid(faces);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
static ShapeResult pointsToFace(std::vector<gp_Pnt>&& points)
|
|
142
|
-
{
|
|
143
|
-
auto wire = pointsToWire(points);
|
|
144
|
-
if (!wire.isOk) {
|
|
145
|
-
return wire;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
BRepBuilderAPI_MakeFace face(TopoDS::Wire(wire.shape));
|
|
149
|
-
if (!face.IsDone()) {
|
|
150
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create face" };
|
|
151
|
-
}
|
|
152
|
-
return ShapeResult { face.Face(), true, "" };
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
static ShapeResult pointsToWire(std::vector<gp_Pnt>& points)
|
|
156
|
-
{
|
|
157
|
-
BRepBuilderAPI_MakePolygon poly;
|
|
158
|
-
for (auto& p : points) {
|
|
159
|
-
poly.Add(p);
|
|
160
|
-
}
|
|
161
|
-
if (!poly.IsDone()) {
|
|
162
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create polygon" };
|
|
163
|
-
}
|
|
164
|
-
return ShapeResult { poly.Wire(), true, "" };
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
static ShapeResult facesToSolid(const std::vector<TopoDS_Face>& faces)
|
|
168
|
-
{
|
|
169
|
-
TopoDS_Shell shell;
|
|
170
|
-
BRep_Builder shellBuilder;
|
|
171
|
-
shellBuilder.MakeShell(shell);
|
|
172
|
-
for (const auto& face : faces) {
|
|
173
|
-
shellBuilder.Add(shell, face);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
BRepBuilderAPI_MakeSolid solidBuilder(shell);
|
|
177
|
-
if (!solidBuilder.IsDone()) {
|
|
178
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create solid" };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return ShapeResult { solidBuilder.Solid(), true, "" };
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
static ShapeResult cylinder(const Vector3& normal, const Vector3& center, double radius, double height)
|
|
185
|
-
{
|
|
186
|
-
gp_Ax2 ax2(Vector3::toPnt(center), Vector3::toDir(normal));
|
|
187
|
-
BRepPrimAPI_MakeCylinder cylinder(ax2, radius, height);
|
|
188
|
-
cylinder.Build();
|
|
189
|
-
if (!cylinder.IsDone()) {
|
|
190
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create cylinder" };
|
|
191
|
-
}
|
|
192
|
-
return ShapeResult { cylinder.Solid(), true, "" };
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
static ShapeResult sweep(const ShapeArray& sections, const TopoDS_Wire& path, bool isFrenet, bool isForceC1)
|
|
196
|
-
{
|
|
197
|
-
BRepOffsetAPI_MakePipeShell pipe(path);
|
|
198
|
-
if (isFrenet) {
|
|
199
|
-
pipe.SetMode(isFrenet);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
if (isForceC1) {
|
|
203
|
-
pipe.SetTransitionMode(BRepBuilderAPI_RoundCorner);
|
|
204
|
-
pipe.SetForceApproxC1(isForceC1);
|
|
205
|
-
} else {
|
|
206
|
-
pipe.SetTransitionMode(BRepBuilderAPI_RightCorner);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
std::vector<TopoDS_Shape> shapesVec = vecFromJSArray<TopoDS_Shape>(sections);
|
|
210
|
-
for (const auto& shape : shapesVec) {
|
|
211
|
-
pipe.Add(shape);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
pipe.Build();
|
|
215
|
-
pipe.MakeSolid();
|
|
216
|
-
|
|
217
|
-
if (!pipe.IsDone()) {
|
|
218
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to sweep profile" };
|
|
219
|
-
}
|
|
220
|
-
return ShapeResult { pipe.Shape(), true, "" };
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
static ShapeResult revolve(const TopoDS_Shape& profile, const Ax1& axis, double rad)
|
|
224
|
-
{
|
|
225
|
-
BRepPrimAPI_MakeRevol revol(profile, Ax1::toAx1(axis), rad);
|
|
226
|
-
if (!revol.IsDone()) {
|
|
227
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to revolve profile" };
|
|
228
|
-
}
|
|
229
|
-
return ShapeResult { revol.Shape(), true, "" };
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
static ShapeResult prism(const TopoDS_Shape& profile, const Vector3& vec)
|
|
233
|
-
{
|
|
234
|
-
gp_Vec vec3 = Vector3::toVec(vec);
|
|
235
|
-
BRepPrimAPI_MakePrism prism(profile, vec3);
|
|
236
|
-
if (!prism.IsDone()) {
|
|
237
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create prism" };
|
|
238
|
-
}
|
|
239
|
-
return ShapeResult { prism.Shape(), true, "" };
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
static ShapeResult polygon(const Vector3Array& points)
|
|
243
|
-
{
|
|
244
|
-
std::vector<Vector3> vector3s = vecFromJSArray<Vector3>(points);
|
|
245
|
-
std::vector<gp_Pnt> pnts;
|
|
246
|
-
for (auto& p : vector3s) {
|
|
247
|
-
pnts.push_back(Vector3::toPnt(p));
|
|
248
|
-
}
|
|
249
|
-
return pointsToWire(pnts);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
static ShapeResult arc(const Vector3& normal, const Vector3& center, const Vector3& start, double rad)
|
|
253
|
-
{
|
|
254
|
-
gp_Pnt centerPnt = Vector3::toPnt(center);
|
|
255
|
-
gp_Pnt startPnt = Vector3::toPnt(start);
|
|
256
|
-
gp_Dir xvec = gp_Dir(startPnt.XYZ() - centerPnt.XYZ());
|
|
257
|
-
gp_Ax2 ax2(centerPnt, Vector3::toDir(normal), xvec);
|
|
258
|
-
gp_Circ circ(ax2, centerPnt.Distance(startPnt));
|
|
259
|
-
double startAng(0), endAng(rad);
|
|
260
|
-
if (rad < 0) {
|
|
261
|
-
startAng = Math::PI_2 + rad;
|
|
262
|
-
endAng = Math::PI_2;
|
|
263
|
-
}
|
|
264
|
-
BRepBuilderAPI_MakeEdge edge(circ, startAng, endAng);
|
|
265
|
-
if (!edge.IsDone()) {
|
|
266
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create arc" };
|
|
267
|
-
}
|
|
268
|
-
return ShapeResult { edge.Edge(), true, "" };
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
static ShapeResult circle(const Vector3& normal, const Vector3& center, double radius)
|
|
272
|
-
{
|
|
273
|
-
gp_Ax2 ax2(Vector3::toPnt(center), Vector3::toDir(normal));
|
|
274
|
-
gp_Circ circ(ax2, radius);
|
|
275
|
-
BRepBuilderAPI_MakeEdge edge(circ);
|
|
276
|
-
if (!edge.IsDone()) {
|
|
277
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create circle" };
|
|
278
|
-
}
|
|
279
|
-
return ShapeResult { edge.Edge(), true, "" };
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
static ShapeResult rect(const Pln& pln, double width, double height)
|
|
283
|
-
{
|
|
284
|
-
BRepBuilderAPI_MakeFace makeFace(Pln::toPln(pln), 0, width, 0, height);
|
|
285
|
-
if (!makeFace.IsDone()) {
|
|
286
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create rectangle" };
|
|
287
|
-
}
|
|
288
|
-
return ShapeResult { makeFace.Face(), true, "" };
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
static ShapeResult bezier(const Vector3Array& points, const NumberArray& weights)
|
|
292
|
-
{
|
|
293
|
-
std::vector<Vector3> pts = vecFromJSArray<Vector3>(points);
|
|
294
|
-
TColgp_Array1OfPnt arrayofPnt(1, pts.size());
|
|
295
|
-
for (int i = 0; i < pts.size(); i++) {
|
|
296
|
-
arrayofPnt.SetValue(i + 1, Vector3::toPnt(pts[i]));
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
std::vector<double> wts = vecFromJSArray<double>(weights);
|
|
300
|
-
TColStd_Array1OfReal arrayOfWeight(1, wts.size());
|
|
301
|
-
for (int i = 0; i < wts.size(); i++) {
|
|
302
|
-
arrayOfWeight.SetValue(i + 1, wts[i]);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
Handle_Geom_Curve curve = wts.size() > 0 ? new Geom_BezierCurve(arrayofPnt, arrayOfWeight) : new Geom_BezierCurve(arrayofPnt);
|
|
306
|
-
BRepBuilderAPI_MakeEdge edge(curve);
|
|
307
|
-
if (!edge.IsDone()) {
|
|
308
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create bezier" };
|
|
309
|
-
}
|
|
310
|
-
return ShapeResult { edge.Edge(), true, "" };
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
static ShapeResult point(const Vector3& point)
|
|
314
|
-
{
|
|
315
|
-
BRepBuilderAPI_MakeVertex makeVertex(Vector3::toPnt(point));
|
|
316
|
-
if (!makeVertex.IsDone()) {
|
|
317
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create point" };
|
|
318
|
-
}
|
|
319
|
-
return ShapeResult { makeVertex.Vertex(), true, "" };
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
static ShapeResult line(const Vector3& start, const Vector3& end)
|
|
323
|
-
{
|
|
324
|
-
BRepBuilderAPI_MakeEdge makeEdge(Vector3::toPnt(start), Vector3::toPnt(end));
|
|
325
|
-
if (!makeEdge.IsDone()) {
|
|
326
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create line" };
|
|
327
|
-
}
|
|
328
|
-
return ShapeResult { makeEdge.Edge(), true, "" };
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
static void orderEdge(BRepBuilderAPI_MakeWire& wire, const std::vector<TopoDS_Edge>& edges)
|
|
332
|
-
{
|
|
333
|
-
ShapeAnalysis_WireOrder order;
|
|
334
|
-
ShapeAnalysis_Edge analysis;
|
|
335
|
-
for (auto& edge : edges) {
|
|
336
|
-
order.Add(BRep_Tool::Pnt(analysis.FirstVertex(edge)).XYZ(),
|
|
337
|
-
BRep_Tool::Pnt(analysis.LastVertex(edge)).XYZ());
|
|
338
|
-
}
|
|
339
|
-
order.Perform(true);
|
|
340
|
-
if (order.IsDone()) {
|
|
341
|
-
for (int i = 0; i < order.NbEdges(); i++) {
|
|
342
|
-
int index = order.Ordered(i + 1);
|
|
343
|
-
auto edge = edges[abs(index) - 1];
|
|
344
|
-
if (index < 0) {
|
|
345
|
-
edge.Reverse();
|
|
346
|
-
}
|
|
347
|
-
wire.Add(edge);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
static ShapeResult wire(const EdgeArray& edges)
|
|
353
|
-
{
|
|
354
|
-
std::vector<TopoDS_Edge> edgesVec = vecFromJSArray<TopoDS_Edge>(edges);
|
|
355
|
-
if (edgesVec.size() == 0) {
|
|
356
|
-
return ShapeResult { TopoDS_Shape(), false, "No edges provided" };
|
|
357
|
-
}
|
|
358
|
-
BRepBuilderAPI_MakeWire wire;
|
|
359
|
-
if (edgesVec.size() == 1) {
|
|
360
|
-
wire.Add(edgesVec[0]);
|
|
361
|
-
} else {
|
|
362
|
-
orderEdge(wire, edgesVec);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
if (!wire.IsDone()) {
|
|
366
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create wire" };
|
|
367
|
-
}
|
|
368
|
-
return ShapeResult { wire.Wire(), true, "" };
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
static ShapeResult face(const WireArray& wires)
|
|
372
|
-
{
|
|
373
|
-
std::vector<TopoDS_Wire> wiresVec = vecFromJSArray<TopoDS_Wire>(wires);
|
|
374
|
-
BRepBuilderAPI_MakeFace makeFace(wiresVec[0]);
|
|
375
|
-
for (int i = 1; i < wiresVec.size(); i++) {
|
|
376
|
-
makeFace.Add(wiresVec[i]);
|
|
377
|
-
}
|
|
378
|
-
if (!makeFace.IsDone()) {
|
|
379
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create face" };
|
|
380
|
-
}
|
|
381
|
-
return ShapeResult { makeFace.Face(), true, "" };
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
static ShapeResult shell(const FaceArray& faces)
|
|
385
|
-
{
|
|
386
|
-
std::vector<TopoDS_Face> facesVec = vecFromJSArray<TopoDS_Face>(faces);
|
|
387
|
-
|
|
388
|
-
TopoDS_Shell shell;
|
|
389
|
-
BRep_Builder shellBuilder;
|
|
390
|
-
shellBuilder.MakeShell(shell);
|
|
391
|
-
for (const auto& face : facesVec) {
|
|
392
|
-
shellBuilder.Add(shell, face);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
return ShapeResult { shell, true, "" };
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
static ShapeResult solid(const ShellArray& shells)
|
|
399
|
-
{
|
|
400
|
-
std::vector<TopoDS_Shell> shellsVec = vecFromJSArray<TopoDS_Shell>(shells);
|
|
401
|
-
|
|
402
|
-
BRepBuilderAPI_MakeSolid makeSolid;
|
|
403
|
-
for (auto shell : shellsVec) {
|
|
404
|
-
makeSolid.Add(shell);
|
|
405
|
-
}
|
|
406
|
-
if (!makeSolid.IsDone()) {
|
|
407
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create solid" };
|
|
408
|
-
}
|
|
409
|
-
return ShapeResult { makeSolid.Solid(), true, "" };
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
static ShapeResult makeThickSolidBySimple(const TopoDS_Shape& shape, double thickness)
|
|
413
|
-
{
|
|
414
|
-
BRepOffsetAPI_MakeThickSolid makeThickSolid;
|
|
415
|
-
makeThickSolid.MakeThickSolidBySimple(shape, thickness);
|
|
416
|
-
if (!makeThickSolid.IsDone()) {
|
|
417
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create thick solid" };
|
|
418
|
-
}
|
|
419
|
-
return ShapeResult { makeThickSolid.Shape(), true, "" };
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
static ShapeResult makeThickSolidByJoin(const TopoDS_Shape& shape, const ShapeArray& shapes, double thickness)
|
|
423
|
-
{
|
|
424
|
-
TopTools_ListOfShape shapesList = shapeArrayToListOfShape(shapes);
|
|
425
|
-
|
|
426
|
-
BRepOffsetAPI_MakeThickSolid makeThickSolid;
|
|
427
|
-
makeThickSolid.MakeThickSolidByJoin(shape, shapesList, thickness, 1e-6);
|
|
428
|
-
if (!makeThickSolid.IsDone()) {
|
|
429
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create thick solid" };
|
|
430
|
-
}
|
|
431
|
-
return ShapeResult { makeThickSolid.Shape(), true, "" };
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
static ShapeResult simplifyShape(
|
|
435
|
-
const TopoDS_Shape& shape,
|
|
436
|
-
const Standard_Boolean theUnifyEdges,
|
|
437
|
-
const Standard_Boolean theUnifyFaces)
|
|
438
|
-
{
|
|
439
|
-
if (!theUnifyEdges && !theUnifyFaces) {
|
|
440
|
-
return ShapeResult { shape, true, "" };
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
ShapeUpgrade_UnifySameDomain anUnifier(shape, theUnifyEdges, theUnifyFaces, Standard_True);
|
|
444
|
-
anUnifier.Build();
|
|
445
|
-
|
|
446
|
-
return ShapeResult { anUnifier.Shape(), true, "" };
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
static ShapeResult booleanOperate(BRepAlgoAPI_BooleanOperation& boolOperater, const ShapeArray& args,
|
|
450
|
-
const ShapeArray& tools)
|
|
451
|
-
{
|
|
452
|
-
TopTools_ListOfShape argsList = shapeArrayToListOfShape(args);
|
|
453
|
-
TopTools_ListOfShape toolsList = shapeArrayToListOfShape(tools);
|
|
454
|
-
|
|
455
|
-
boolOperater.SetToFillHistory(false);
|
|
456
|
-
boolOperater.SetArguments(argsList);
|
|
457
|
-
boolOperater.SetTools(toolsList);
|
|
458
|
-
boolOperater.Build();
|
|
459
|
-
if (!boolOperater.IsDone()) {
|
|
460
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to build boolean operation" };
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
return ShapeResult { boolOperater.Shape(), true, "" };
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
static ShapeResult booleanCommon(const ShapeArray& args, const ShapeArray& tools)
|
|
467
|
-
{
|
|
468
|
-
BRepAlgoAPI_Common api;
|
|
469
|
-
return booleanOperate(api, args, tools);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
static ShapeResult booleanCut(const ShapeArray& args, const ShapeArray& tools)
|
|
473
|
-
{
|
|
474
|
-
BRepAlgoAPI_Cut api;
|
|
475
|
-
return booleanOperate(api, args, tools);
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
static ShapeResult booleanFuse(const ShapeArray& args, const ShapeArray& tools)
|
|
479
|
-
{
|
|
480
|
-
BRepAlgoAPI_Fuse api;
|
|
481
|
-
return booleanOperate(api, args, tools);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
static ShapeResult combine(const ShapeArray& shapes)
|
|
485
|
-
{
|
|
486
|
-
std::vector<TopoDS_Shape> shapesVec = vecFromJSArray<TopoDS_Shape>(shapes);
|
|
487
|
-
TopoDS_Compound compound;
|
|
488
|
-
BRep_Builder builder;
|
|
489
|
-
builder.MakeCompound(compound);
|
|
490
|
-
for (auto shape : shapesVec) {
|
|
491
|
-
builder.Add(compound, shape);
|
|
492
|
-
}
|
|
493
|
-
return ShapeResult { compound, true, "" };
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
static ShapeResult fillet(const TopoDS_Shape& shape, const NumberArray& edges, double radius)
|
|
497
|
-
{
|
|
498
|
-
std::vector<int> edgeVec = vecFromJSArray<int>(edges);
|
|
499
|
-
|
|
500
|
-
TopTools_IndexedMapOfShape edgeMap;
|
|
501
|
-
TopExp::MapShapes(shape, TopAbs_EDGE, edgeMap);
|
|
502
|
-
|
|
503
|
-
BRepFilletAPI_MakeFillet makeFillet(shape);
|
|
504
|
-
for (auto edge : edgeVec) {
|
|
505
|
-
makeFillet.Add(radius, TopoDS::Edge(edgeMap.FindKey(edge + 1)));
|
|
506
|
-
}
|
|
507
|
-
makeFillet.Build();
|
|
508
|
-
if (!makeFillet.IsDone()) {
|
|
509
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to fillet" };
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
return ShapeResult { makeFillet.Shape(), true, "" };
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
static ShapeResult chamfer(const TopoDS_Shape& shape, const NumberArray& edges, double distance)
|
|
516
|
-
{
|
|
517
|
-
std::vector<int> edgeVec = vecFromJSArray<int>(edges);
|
|
518
|
-
|
|
519
|
-
TopTools_IndexedMapOfShape edgeMap;
|
|
520
|
-
TopExp::MapShapes(shape, TopAbs_EDGE, edgeMap);
|
|
521
|
-
|
|
522
|
-
BRepFilletAPI_MakeChamfer makeChamfer(shape);
|
|
523
|
-
for (auto edge : edgeVec) {
|
|
524
|
-
makeChamfer.Add(distance, TopoDS::Edge(edgeMap.FindKey(edge + 1)));
|
|
525
|
-
}
|
|
526
|
-
makeChamfer.Build();
|
|
527
|
-
if (!makeChamfer.IsDone()) {
|
|
528
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to chamfer" };
|
|
529
|
-
}
|
|
530
|
-
return ShapeResult { makeChamfer.Shape(), true, "" };
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
static ShapeResult loft(const ShapeArray& sections, bool isSolid, bool isRuled, GeomAbs_Shape continuity)
|
|
534
|
-
{
|
|
535
|
-
std::vector<TopoDS_Shape> shapeVector = emscripten::vecFromJSArray<TopoDS_Shape>(sections);
|
|
536
|
-
if (shapeVector.size() < 2) {
|
|
537
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to loft: at least 2 sections are required" };
|
|
538
|
-
}
|
|
539
|
-
if (shapeVector.size() == 2 && shapeVector[0].ShapeType() == TopAbs_VERTEX && shapeVector[1].ShapeType() == TopAbs_VERTEX) {
|
|
540
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to loft: must have at least 1 wires" };
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
BRepOffsetAPI_ThruSections loftBuilder(isSolid, isRuled);
|
|
544
|
-
if (!isRuled) {
|
|
545
|
-
loftBuilder.SetContinuity(continuity);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
for (auto& profile : shapeVector) {
|
|
549
|
-
if (profile.ShapeType() == TopAbs_WIRE) {
|
|
550
|
-
loftBuilder.AddWire(TopoDS::Wire(profile));
|
|
551
|
-
} else if (profile.ShapeType() == TopAbs_VERTEX) {
|
|
552
|
-
loftBuilder.AddVertex(TopoDS::Vertex(profile));
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
loftBuilder.Build();
|
|
556
|
-
if (!loftBuilder.IsDone()) {
|
|
557
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to loft" };
|
|
558
|
-
}
|
|
559
|
-
return ShapeResult { loftBuilder.Shape(), true, "" };
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
static ShapeResult curveProjection(const TopoDS_Shape& curve, const TopoDS_Shape& targetFace, const gp_Dir& dir)
|
|
563
|
-
{
|
|
564
|
-
BRepProj_Projection curveProjection(curve, targetFace, dir);
|
|
565
|
-
if (!curveProjection.IsDone()) {
|
|
566
|
-
return ShapeResult { TopoDS_Shape(), false, "Failed to create curve projection" };
|
|
567
|
-
}
|
|
568
|
-
return ShapeResult { curveProjection.Shape(), true, "" };
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
|
-
|
|
572
|
-
EMSCRIPTEN_BINDINGS(ShapeFactory)
|
|
573
|
-
{
|
|
574
|
-
class_<ShapeResult>("ShapeResult")
|
|
575
|
-
.property("shape", &ShapeResult::shape, return_value_policy::reference())
|
|
576
|
-
.property("isOk", &ShapeResult::isOk)
|
|
577
|
-
.property("error", &ShapeResult::error);
|
|
578
|
-
|
|
579
|
-
class_<ShapeFactory>("ShapeFactory")
|
|
580
|
-
.class_function("box", &ShapeFactory::box)
|
|
581
|
-
.class_function("cone", &ShapeFactory::cone)
|
|
582
|
-
.class_function("sphere", &ShapeFactory::sphere)
|
|
583
|
-
.class_function("ellipsoid", &ShapeFactory::ellipsoid)
|
|
584
|
-
.class_function("ellipse", &ShapeFactory::ellipse)
|
|
585
|
-
.class_function("cylinder", &ShapeFactory::cylinder)
|
|
586
|
-
.class_function("pyramid", &ShapeFactory::pyramid)
|
|
587
|
-
.class_function("sweep", &ShapeFactory::sweep)
|
|
588
|
-
.class_function("revolve", &ShapeFactory::revolve)
|
|
589
|
-
.class_function("prism", &ShapeFactory::prism)
|
|
590
|
-
.class_function("polygon", &ShapeFactory::polygon)
|
|
591
|
-
.class_function("circle", &ShapeFactory::circle)
|
|
592
|
-
.class_function("arc", &ShapeFactory::arc)
|
|
593
|
-
.class_function("bezier", &ShapeFactory::bezier)
|
|
594
|
-
.class_function("rect", &ShapeFactory::rect)
|
|
595
|
-
.class_function("point", &ShapeFactory::point)
|
|
596
|
-
.class_function("line", &ShapeFactory::line)
|
|
597
|
-
.class_function("wire", &ShapeFactory::wire)
|
|
598
|
-
.class_function("face", &ShapeFactory::face)
|
|
599
|
-
.class_function("shell", &ShapeFactory::shell)
|
|
600
|
-
.class_function("solid", &ShapeFactory::solid)
|
|
601
|
-
.class_function("makeThickSolidBySimple", &ShapeFactory::makeThickSolidBySimple)
|
|
602
|
-
.class_function("makeThickSolidByJoin", &ShapeFactory::makeThickSolidByJoin)
|
|
603
|
-
.class_function("simplifyShape", &ShapeFactory::simplifyShape)
|
|
604
|
-
.class_function("booleanCommon", &ShapeFactory::booleanCommon)
|
|
605
|
-
.class_function("booleanCut", &ShapeFactory::booleanCut)
|
|
606
|
-
.class_function("booleanFuse", &ShapeFactory::booleanFuse)
|
|
607
|
-
.class_function("combine", &ShapeFactory::combine)
|
|
608
|
-
.class_function("fillet", &ShapeFactory::fillet)
|
|
609
|
-
.class_function("chamfer", &ShapeFactory::chamfer)
|
|
610
|
-
.class_function("loft", &ShapeFactory::loft)
|
|
611
|
-
.class_function("curveProjection", &ShapeFactory::curveProjection);
|
|
612
|
-
}
|