chili3d 0.6.1
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/.github/workflows/main.yml +26 -0
- package/.vscode/c_cpp_properties.json +30 -0
- package/.vscode/launch.json +21 -0
- package/.vscode/settings.json +8 -0
- package/Dockerfile +7 -0
- package/LICENSE +661 -0
- package/README.md +184 -0
- package/biome.json +67 -0
- package/compose.yml +7 -0
- package/cpp/CMakeLists.txt +96 -0
- package/cpp/CMakePresets.json +43 -0
- package/cpp/README.md +21 -0
- package/cpp/src/converter.cpp +413 -0
- package/cpp/src/factory.cpp +612 -0
- package/cpp/src/geometry.cpp +204 -0
- package/cpp/src/mesher.cpp +330 -0
- package/cpp/src/opencascade.cpp +414 -0
- package/cpp/src/shape.cpp +447 -0
- package/cpp/src/shared.cpp +83 -0
- package/cpp/src/shared.hpp +211 -0
- package/cpp/src/transient.cpp +29 -0
- package/cpp/src/utils.cpp +114 -0
- package/cpp/src/utils.hpp +25 -0
- package/cpp/test/index.html +146 -0
- package/package.json +49 -0
- package/packages/chili/package.json +11 -0
- package/packages/chili/src/application.ts +200 -0
- package/packages/chili/src/bodys/arc.ts +61 -0
- package/packages/chili/src/bodys/boolean.ts +32 -0
- package/packages/chili/src/bodys/box.ts +73 -0
- package/packages/chili/src/bodys/circle.ts +57 -0
- package/packages/chili/src/bodys/cone.ts +64 -0
- package/packages/chili/src/bodys/cylinder.ts +69 -0
- package/packages/chili/src/bodys/ellipse.ts +85 -0
- package/packages/chili/src/bodys/face.ts +72 -0
- package/packages/chili/src/bodys/fuse.ts +44 -0
- package/packages/chili/src/bodys/index.ts +16 -0
- package/packages/chili/src/bodys/line.ts +48 -0
- package/packages/chili/src/bodys/polygon.ts +40 -0
- package/packages/chili/src/bodys/prism.ts +49 -0
- package/packages/chili/src/bodys/pyramid.ts +64 -0
- package/packages/chili/src/bodys/rect.ts +69 -0
- package/packages/chili/src/bodys/revolve.ts +54 -0
- package/packages/chili/src/bodys/sphere.ts +48 -0
- package/packages/chili/src/bodys/sweep.ts +67 -0
- package/packages/chili/src/bodys/wire.ts +36 -0
- package/packages/chili/src/commands/application/index.ts +10 -0
- package/packages/chili/src/commands/application/newDocument.ts +17 -0
- package/packages/chili/src/commands/application/openDocument.ts +35 -0
- package/packages/chili/src/commands/application/performanceTest.ts +64 -0
- package/packages/chili/src/commands/application/saveDocument.ts +24 -0
- package/packages/chili/src/commands/application/toFile.ts +35 -0
- package/packages/chili/src/commands/application/toggleDynamicWorkplane.ts +15 -0
- package/packages/chili/src/commands/application/wechatGroup.ts +42 -0
- package/packages/chili/src/commands/boolean.ts +109 -0
- package/packages/chili/src/commands/create/arc.ts +110 -0
- package/packages/chili/src/commands/create/bezier.ts +116 -0
- package/packages/chili/src/commands/create/box.ts +59 -0
- package/packages/chili/src/commands/create/circle.ts +54 -0
- package/packages/chili/src/commands/create/cone.ts +104 -0
- package/packages/chili/src/commands/create/converter.ts +159 -0
- package/packages/chili/src/commands/create/copySubShape.ts +37 -0
- package/packages/chili/src/commands/create/curveProjection.ts +61 -0
- package/packages/chili/src/commands/create/cylinder.ts +96 -0
- package/packages/chili/src/commands/create/ellipse.ts +95 -0
- package/packages/chili/src/commands/create/group.ts +205 -0
- package/packages/chili/src/commands/create/index.ts +26 -0
- package/packages/chili/src/commands/create/line.ts +61 -0
- package/packages/chili/src/commands/create/loft.ts +149 -0
- package/packages/chili/src/commands/create/offset.ts +131 -0
- package/packages/chili/src/commands/create/polygon.ts +104 -0
- package/packages/chili/src/commands/create/prism.ts +52 -0
- package/packages/chili/src/commands/create/pyramid.ts +56 -0
- package/packages/chili/src/commands/create/rect.ts +105 -0
- package/packages/chili/src/commands/create/revolve.ts +62 -0
- package/packages/chili/src/commands/create/section.ts +31 -0
- package/packages/chili/src/commands/create/sphere.ts +48 -0
- package/packages/chili/src/commands/create/sweep.ts +39 -0
- package/packages/chili/src/commands/create/thickSolid.ts +50 -0
- package/packages/chili/src/commands/createActCommand.ts +26 -0
- package/packages/chili/src/commands/createCommand.ts +41 -0
- package/packages/chili/src/commands/delete.ts +38 -0
- package/packages/chili/src/commands/folder.ts +18 -0
- package/packages/chili/src/commands/importExport.ts +97 -0
- package/packages/chili/src/commands/index.ts +17 -0
- package/packages/chili/src/commands/measure/angle.ts +130 -0
- package/packages/chili/src/commands/measure/index.ts +6 -0
- package/packages/chili/src/commands/measure/length.ts +57 -0
- package/packages/chili/src/commands/measure/select.module.css +68 -0
- package/packages/chili/src/commands/measure/select.ts +228 -0
- package/packages/chili/src/commands/modify/array.ts +447 -0
- package/packages/chili/src/commands/modify/break.ts +78 -0
- package/packages/chili/src/commands/modify/brush.ts +100 -0
- package/packages/chili/src/commands/modify/chamfer.ts +70 -0
- package/packages/chili/src/commands/modify/explode.ts +91 -0
- package/packages/chili/src/commands/modify/fillet.ts +69 -0
- package/packages/chili/src/commands/modify/index.ts +16 -0
- package/packages/chili/src/commands/modify/mirror.ts +49 -0
- package/packages/chili/src/commands/modify/move.ts +39 -0
- package/packages/chili/src/commands/modify/removeFeature.ts +56 -0
- package/packages/chili/src/commands/modify/removeSubShapes.ts +44 -0
- package/packages/chili/src/commands/modify/rotate.ts +112 -0
- package/packages/chili/src/commands/modify/split.ts +81 -0
- package/packages/chili/src/commands/modify/transformedCommand.ts +100 -0
- package/packages/chili/src/commands/modify/trim.ts +254 -0
- package/packages/chili/src/commands/multistepCommand.ts +125 -0
- package/packages/chili/src/commands/redo.ts +16 -0
- package/packages/chili/src/commands/undo.ts +16 -0
- package/packages/chili/src/commands/workingPlane.ts +150 -0
- package/packages/chili/src/comparers/NumberEqualityComparer.ts +12 -0
- package/packages/chili/src/comparers/XYZEqualityComparer.ts +12 -0
- package/packages/chili/src/comparers/index.ts +5 -0
- package/packages/chili/src/document.ts +145 -0
- package/packages/chili/src/editEventHandler.ts +20 -0
- package/packages/chili/src/index.ts +12 -0
- package/packages/chili/src/selection.ts +178 -0
- package/packages/chili/src/services/commandService.ts +105 -0
- package/packages/chili/src/services/editorService.ts +46 -0
- package/packages/chili/src/services/hotkeyService.ts +102 -0
- package/packages/chili/src/services/index.ts +6 -0
- package/packages/chili/src/snap/dimension.ts +33 -0
- package/packages/chili/src/snap/handlers/angleSnapEventHandler.ts +60 -0
- package/packages/chili/src/snap/handlers/index.ts +7 -0
- package/packages/chili/src/snap/handlers/lengthSnapEventHandler.ts +117 -0
- package/packages/chili/src/snap/handlers/pointSnapEventHandler.ts +176 -0
- package/packages/chili/src/snap/handlers/snapEventHandler.ts +288 -0
- package/packages/chili/src/snap/index.ts +6 -0
- package/packages/chili/src/snap/snap.ts +50 -0
- package/packages/chili/src/snap/snaps/axisSnap.ts +57 -0
- package/packages/chili/src/snap/snaps/baseSnap.ts +69 -0
- package/packages/chili/src/snap/snaps/featurePointStrategy.ts +64 -0
- package/packages/chili/src/snap/snaps/index.ts +7 -0
- package/packages/chili/src/snap/snaps/objectSnap.ts +264 -0
- package/packages/chili/src/snap/snaps/planeSnap.ts +55 -0
- package/packages/chili/src/snap/snaps/pointOnCurveSnap.ts +24 -0
- package/packages/chili/src/snap/tracking/axis.ts +32 -0
- package/packages/chili/src/snap/tracking/axisTracking.ts +46 -0
- package/packages/chili/src/snap/tracking/index.ts +6 -0
- package/packages/chili/src/snap/tracking/objectTracking.ts +90 -0
- package/packages/chili/src/snap/tracking/trackingBase.ts +40 -0
- package/packages/chili/src/snap/tracking/trackingSnap.ts +201 -0
- package/packages/chili/src/step/angleStep.ts +32 -0
- package/packages/chili/src/step/index.ts +8 -0
- package/packages/chili/src/step/lengthStep.ts +32 -0
- package/packages/chili/src/step/pointStep.ts +87 -0
- package/packages/chili/src/step/selectStep.ts +130 -0
- package/packages/chili/src/step/step.ts +55 -0
- package/packages/chili/src/utils.ts +19 -0
- package/packages/chili/test/command.test.ts +4 -0
- package/packages/chili-builder/package.json +13 -0
- package/packages/chili-builder/src/additionalModule.ts +15 -0
- package/packages/chili-builder/src/appBuilder.ts +176 -0
- package/packages/chili-builder/src/defaultDataExchange.ts +152 -0
- package/packages/chili-builder/src/index.ts +5 -0
- package/packages/chili-builder/src/ribbon.ts +129 -0
- package/packages/chili-controls/package.json +9 -0
- package/packages/chili-controls/src/collection.ts +96 -0
- package/packages/chili-controls/src/controls.ts +83 -0
- package/packages/chili-controls/src/converters/colorConverter.ts +39 -0
- package/packages/chili-controls/src/converters/index.ts +8 -0
- package/packages/chili-controls/src/converters/numberConverter.ts +15 -0
- package/packages/chili-controls/src/converters/stringConverter.ts +13 -0
- package/packages/chili-controls/src/converters/urlConverter.ts +10 -0
- package/packages/chili-controls/src/converters/xyzConverter.ts +28 -0
- package/packages/chili-controls/src/expander/expander.module.css +38 -0
- package/packages/chili-controls/src/expander/expander.ts +59 -0
- package/packages/chili-controls/src/expander/index.ts +4 -0
- package/packages/chili-controls/src/htmlProps.ts +10 -0
- package/packages/chili-controls/src/index.ts +10 -0
- package/packages/chili-controls/src/radioGroup.module.css +20 -0
- package/packages/chili-controls/src/radioGroup.ts +54 -0
- package/packages/chili-controls/src/utils.ts +20 -0
- package/packages/chili-controls/test/converter.test.ts +70 -0
- package/packages/chili-controls/test/styleMock.js +4 -0
- package/packages/chili-core/package.json +7 -0
- package/packages/chili-core/src/application.ts +38 -0
- package/packages/chili-core/src/command/command.ts +154 -0
- package/packages/chili-core/src/command/commandKeys.ts +8 -0
- package/packages/chili-core/src/command/decarator.ts +43 -0
- package/packages/chili-core/src/command/index.ts +6 -0
- package/packages/chili-core/src/config.ts +145 -0
- package/packages/chili-core/src/constants.ts +8 -0
- package/packages/chili-core/src/dataExchange.ts +12 -0
- package/packages/chili-core/src/document.ts +25 -0
- package/packages/chili-core/src/editor.ts +12 -0
- package/packages/chili-core/src/foundation/asyncController.ts +55 -0
- package/packages/chili-core/src/foundation/binding.ts +132 -0
- package/packages/chili-core/src/foundation/collection.ts +208 -0
- package/packages/chili-core/src/foundation/converter.ts +9 -0
- package/packages/chili-core/src/foundation/deepObserver.ts +154 -0
- package/packages/chili-core/src/foundation/disposable.ts +18 -0
- package/packages/chili-core/src/foundation/dto/index.ts +9 -0
- package/packages/chili-core/src/foundation/equalityComparer.ts +6 -0
- package/packages/chili-core/src/foundation/gc.ts +36 -0
- package/packages/chili-core/src/foundation/history.ts +237 -0
- package/packages/chili-core/src/foundation/id.ts +25 -0
- package/packages/chili-core/src/foundation/index.ts +26 -0
- package/packages/chili-core/src/foundation/lazy.ts +18 -0
- package/packages/chili-core/src/foundation/linkedList.ts +141 -0
- package/packages/chili-core/src/foundation/logger.ts +45 -0
- package/packages/chili-core/src/foundation/messageType.ts +8 -0
- package/packages/chili-core/src/foundation/objectStorage.ts +50 -0
- package/packages/chili-core/src/foundation/observer.ts +147 -0
- package/packages/chili-core/src/foundation/precision.ts +8 -0
- package/packages/chili-core/src/foundation/pubsub.ts +74 -0
- package/packages/chili-core/src/foundation/result.ts +69 -0
- package/packages/chili-core/src/foundation/storage.ts +10 -0
- package/packages/chili-core/src/foundation/transaction.ts +77 -0
- package/packages/chili-core/src/foundation/utils/debounce.ts +15 -0
- package/packages/chili-core/src/foundation/utils/download.ts +16 -0
- package/packages/chili-core/src/foundation/utils/index.ts +6 -0
- package/packages/chili-core/src/foundation/utils/readFileAsync.ts +84 -0
- package/packages/chili-core/src/i18n/i18n.ts +107 -0
- package/packages/chili-core/src/i18n/index.ts +5 -0
- package/packages/chili-core/src/i18n/keys.ts +265 -0
- package/packages/chili-core/src/index.ts +26 -0
- package/packages/chili-core/src/material.ts +269 -0
- package/packages/chili-core/src/math/boundingBox.ts +226 -0
- package/packages/chili-core/src/math/index.ts +14 -0
- package/packages/chili-core/src/math/line.ts +55 -0
- package/packages/chili-core/src/math/lineSegment.ts +166 -0
- package/packages/chili-core/src/math/mathUtils.ts +45 -0
- package/packages/chili-core/src/math/matrix4.ts +414 -0
- package/packages/chili-core/src/math/plane.ts +96 -0
- package/packages/chili-core/src/math/planeAngle.ts +53 -0
- package/packages/chili-core/src/math/quaternion.ts +131 -0
- package/packages/chili-core/src/math/ray.ts +30 -0
- package/packages/chili-core/src/math/xy.ts +104 -0
- package/packages/chili-core/src/math/xyz.ts +181 -0
- package/packages/chili-core/src/model/component.ts +305 -0
- package/packages/chili-core/src/model/facebaseNode.ts +17 -0
- package/packages/chili-core/src/model/folderNode.ts +289 -0
- package/packages/chili-core/src/model/geometryNode.ts +185 -0
- package/packages/chili-core/src/model/groupNode.ts +19 -0
- package/packages/chili-core/src/model/index.ts +12 -0
- package/packages/chili-core/src/model/meshNode.ts +53 -0
- package/packages/chili-core/src/model/node.ts +315 -0
- package/packages/chili-core/src/model/shapeNode.ts +195 -0
- package/packages/chili-core/src/model/visualNode.ts +39 -0
- package/packages/chili-core/src/modelManager.ts +147 -0
- package/packages/chili-core/src/navigation.ts +58 -0
- package/packages/chili-core/src/property.ts +60 -0
- package/packages/chili-core/src/selection.ts +33 -0
- package/packages/chili-core/src/selectionFilter.ts +28 -0
- package/packages/chili-core/src/serialize/index.ts +4 -0
- package/packages/chili-core/src/serialize/serializer.ts +231 -0
- package/packages/chili-core/src/service.ts +10 -0
- package/packages/chili-core/src/shape/curve.ts +174 -0
- package/packages/chili-core/src/shape/geometry.ts +17 -0
- package/packages/chili-core/src/shape/index.ts +12 -0
- package/packages/chili-core/src/shape/lineType.ts +7 -0
- package/packages/chili-core/src/shape/meshData.ts +347 -0
- package/packages/chili-core/src/shape/shape.ts +104 -0
- package/packages/chili-core/src/shape/shapeConverter.ts +17 -0
- package/packages/chili-core/src/shape/shapeFactory.ts +58 -0
- package/packages/chili-core/src/shape/shapeType.ts +75 -0
- package/packages/chili-core/src/shape/surface.ts +154 -0
- package/packages/chili-core/src/snapType.ts +32 -0
- package/packages/chili-core/src/ui/button.ts +16 -0
- package/packages/chili-core/src/ui/combobox.ts +27 -0
- package/packages/chili-core/src/ui/dialog.ts +7 -0
- package/packages/chili-core/src/ui/index.ts +8 -0
- package/packages/chili-core/src/ui/ribbon.ts +15 -0
- package/packages/chili-core/src/ui/window.ts +13 -0
- package/packages/chili-core/src/visual/act.ts +59 -0
- package/packages/chili-core/src/visual/cameraController.ts +22 -0
- package/packages/chili-core/src/visual/cursorType.ts +4 -0
- package/packages/chili-core/src/visual/detectedData.ts +14 -0
- package/packages/chili-core/src/visual/eventHandler.ts +15 -0
- package/packages/chili-core/src/visual/highlighter.ts +16 -0
- package/packages/chili-core/src/visual/index.ts +20 -0
- package/packages/chili-core/src/visual/meshExporter.ts +11 -0
- package/packages/chili-core/src/visual/meshUtils.ts +276 -0
- package/packages/chili-core/src/visual/textGenerator.ts +8 -0
- package/packages/chili-core/src/visual/view.ts +80 -0
- package/packages/chili-core/src/visual/viewGizmo.ts +8 -0
- package/packages/chili-core/src/visual/viewport.ts +10 -0
- package/packages/chili-core/src/visual/visual.ts +24 -0
- package/packages/chili-core/src/visual/visualContext.ts +29 -0
- package/packages/chili-core/src/visual/visualFactory.ts +10 -0
- package/packages/chili-core/src/visual/visualObject.ts +25 -0
- package/packages/chili-core/src/visual/visualShape.ts +30 -0
- package/packages/chili-core/test/binding.test.ts +95 -0
- package/packages/chili-core/test/boundingBox.test.ts +60 -0
- package/packages/chili-core/test/collection.test.ts +53 -0
- package/packages/chili-core/test/history.test.ts +42 -0
- package/packages/chili-core/test/line.test.ts +75 -0
- package/packages/chili-core/test/linesegment.test.ts +98 -0
- package/packages/chili-core/test/linkedList.test.ts +82 -0
- package/packages/chili-core/test/math.test.ts +34 -0
- package/packages/chili-core/test/matrix.test.ts +129 -0
- package/packages/chili-core/test/node.test.ts +122 -0
- package/packages/chili-core/test/nodeList.test.ts +247 -0
- package/packages/chili-core/test/observer.test.ts +91 -0
- package/packages/chili-core/test/plane.test.ts +31 -0
- package/packages/chili-core/test/quaternion.test.ts +14 -0
- package/packages/chili-core/test/result.test.ts +24 -0
- package/packages/chili-core/test/serializer.test.ts +58 -0
- package/packages/chili-core/test/snapType.test.ts +10 -0
- package/packages/chili-core/test/task.test.ts +41 -0
- package/packages/chili-core/test/testDocument.ts +70 -0
- package/packages/chili-core/test/transaction.test.ts +42 -0
- package/packages/chili-core/test/visual.test.ts +42 -0
- package/packages/chili-core/test/xyz.test.ts +260 -0
- package/packages/chili-geo/package.json +9 -0
- package/packages/chili-geo/src/index.ts +4 -0
- package/packages/chili-geo/src/utils.ts +113 -0
- package/packages/chili-i18n/package.json +9 -0
- package/packages/chili-i18n/src/en.ts +270 -0
- package/packages/chili-i18n/src/index.ts +8 -0
- package/packages/chili-i18n/src/pt-br.ts +67 -0
- package/packages/chili-i18n/src/zh-cn.ts +269 -0
- package/packages/chili-storage/package.json +9 -0
- package/packages/chili-storage/src/index.ts +4 -0
- package/packages/chili-storage/src/indexedDBStorage.ts +150 -0
- package/packages/chili-three/package.json +13 -0
- package/packages/chili-three/src/cameraController.ts +335 -0
- package/packages/chili-three/src/common.ts +65 -0
- package/packages/chili-three/src/constants.ts +12 -0
- package/packages/chili-three/src/highlightable.ts +13 -0
- package/packages/chili-three/src/index.ts +4 -0
- package/packages/chili-three/src/meshExporter.ts +69 -0
- package/packages/chili-three/src/outlinePass.js +340 -0
- package/packages/chili-three/src/texture_points.jpg +0 -0
- package/packages/chili-three/src/threeGeometry.ts +207 -0
- package/packages/chili-three/src/threeGeometryFactory.ts +120 -0
- package/packages/chili-three/src/threeHelper.ts +174 -0
- package/packages/chili-three/src/threeHighlighter.ts +257 -0
- package/packages/chili-three/src/threeView.module.css +39 -0
- package/packages/chili-three/src/threeView.ts +669 -0
- package/packages/chili-three/src/threeViewEventHandler.ts +193 -0
- package/packages/chili-three/src/threeVisual.ts +92 -0
- package/packages/chili-three/src/threeVisualContext.ts +435 -0
- package/packages/chili-three/src/threeVisualFactory.ts +12 -0
- package/packages/chili-three/src/threeVisualObject.ts +442 -0
- package/packages/chili-three/src/viewGizmo.ts +305 -0
- package/packages/chili-three/test/cameraControls.ts +10 -0
- package/packages/chili-three/test/testDocument.ts +68 -0
- package/packages/chili-three/test/testEdge.ts +171 -0
- package/packages/chili-three/test/testView.ts +78 -0
- package/packages/chili-three/test/three.test.ts +44 -0
- package/packages/chili-three/test/viewGizmo.ts +12 -0
- package/packages/chili-ui/package.json +12 -0
- package/packages/chili-ui/src/cursor/draw.cur +0 -0
- package/packages/chili-ui/src/cursor/index.ts +17 -0
- package/packages/chili-ui/src/dialog.module.css +63 -0
- package/packages/chili-ui/src/dialog.ts +42 -0
- package/packages/chili-ui/src/editor.module.css +83 -0
- package/packages/chili-ui/src/editor.ts +142 -0
- package/packages/chili-ui/src/home/home.module.css +301 -0
- package/packages/chili-ui/src/home/home.ts +243 -0
- package/packages/chili-ui/src/home/index.ts +4 -0
- package/packages/chili-ui/src/home/languageSelector.ts +27 -0
- package/packages/chili-ui/src/home/navigation3DSelector.ts +27 -0
- package/packages/chili-ui/src/home/themeSelector.ts +34 -0
- package/packages/chili-ui/src/index.ts +5 -0
- package/packages/chili-ui/src/mainWindow.module.css +144 -0
- package/packages/chili-ui/src/mainWindow.ts +154 -0
- package/packages/chili-ui/src/okCancel.module.css +54 -0
- package/packages/chili-ui/src/okCancel.ts +58 -0
- package/packages/chili-ui/src/permanent.module.css +44 -0
- package/packages/chili-ui/src/permanent.ts +31 -0
- package/packages/chili-ui/src/project/index.ts +4 -0
- package/packages/chili-ui/src/project/projectView.module.css +37 -0
- package/packages/chili-ui/src/project/projectView.ts +77 -0
- package/packages/chili-ui/src/project/toolBar.module.css +16 -0
- package/packages/chili-ui/src/project/toolBar.ts +73 -0
- package/packages/chili-ui/src/project/tree/index.ts +5 -0
- package/packages/chili-ui/src/project/tree/tree.module.css +16 -0
- package/packages/chili-ui/src/project/tree/tree.ts +265 -0
- package/packages/chili-ui/src/project/tree/treeItem.module.css +21 -0
- package/packages/chili-ui/src/project/tree/treeItem.ts +89 -0
- package/packages/chili-ui/src/project/tree/treeItemGroup.module.css +33 -0
- package/packages/chili-ui/src/project/tree/treeItemGroup.ts +85 -0
- package/packages/chili-ui/src/project/tree/treeModel.module.css +11 -0
- package/packages/chili-ui/src/project/tree/treeModel.ts +20 -0
- package/packages/chili-ui/src/property/check.ts +39 -0
- package/packages/chili-ui/src/property/colorPorperty.module.css +6 -0
- package/packages/chili-ui/src/property/colorProperty.ts +63 -0
- package/packages/chili-ui/src/property/common.module.css +14 -0
- package/packages/chili-ui/src/property/index.ts +4 -0
- package/packages/chili-ui/src/property/input.module.css +19 -0
- package/packages/chili-ui/src/property/input.ts +140 -0
- package/packages/chili-ui/src/property/material/index.ts +5 -0
- package/packages/chili-ui/src/property/material/materialDataContent.ts +44 -0
- package/packages/chili-ui/src/property/material/materialEditor.module.css +98 -0
- package/packages/chili-ui/src/property/material/materialEditor.ts +147 -0
- package/packages/chili-ui/src/property/material/textureEditor.module.css +46 -0
- package/packages/chili-ui/src/property/material/textureEditor.ts +61 -0
- package/packages/chili-ui/src/property/materialProperty.module.css +30 -0
- package/packages/chili-ui/src/property/materialProperty.ts +86 -0
- package/packages/chili-ui/src/property/matrixProperty.ts +147 -0
- package/packages/chili-ui/src/property/propertyBase.module.css +3 -0
- package/packages/chili-ui/src/property/propertyBase.ts +14 -0
- package/packages/chili-ui/src/property/propertyView.module.css +36 -0
- package/packages/chili-ui/src/property/propertyView.ts +115 -0
- package/packages/chili-ui/src/property/utils.ts +48 -0
- package/packages/chili-ui/src/ribbon/commandContext.module.css +73 -0
- package/packages/chili-ui/src/ribbon/commandContext.ts +239 -0
- package/packages/chili-ui/src/ribbon/index.ts +4 -0
- package/packages/chili-ui/src/ribbon/ribbon.module.css +286 -0
- package/packages/chili-ui/src/ribbon/ribbon.ts +288 -0
- package/packages/chili-ui/src/ribbon/ribbonButton.module.css +75 -0
- package/packages/chili-ui/src/ribbon/ribbonButton.ts +88 -0
- package/packages/chili-ui/src/ribbon/ribbonData.ts +66 -0
- package/packages/chili-ui/src/ribbon/ribbonStack.module.css +6 -0
- package/packages/chili-ui/src/ribbon/ribbonStack.ts +13 -0
- package/packages/chili-ui/src/ribbon/ribbonToggleButton.module.css +3 -0
- package/packages/chili-ui/src/ribbon/ribbonToggleButton.ts +6 -0
- package/packages/chili-ui/src/statusbar/index.ts +4 -0
- package/packages/chili-ui/src/statusbar/snapConfig.module.css +25 -0
- package/packages/chili-ui/src/statusbar/snapConfig.ts +92 -0
- package/packages/chili-ui/src/statusbar/statusbar.module.css +28 -0
- package/packages/chili-ui/src/statusbar/statusbar.ts +54 -0
- package/packages/chili-ui/src/toast/index.ts +4 -0
- package/packages/chili-ui/src/toast/toast.module.css +27 -0
- package/packages/chili-ui/src/toast/toast.ts +39 -0
- package/packages/chili-ui/src/viewport/flyout/flyout.module.css +9 -0
- package/packages/chili-ui/src/viewport/flyout/flyout.ts +77 -0
- package/packages/chili-ui/src/viewport/flyout/index.ts +6 -0
- package/packages/chili-ui/src/viewport/flyout/input.module.css +21 -0
- package/packages/chili-ui/src/viewport/flyout/input.ts +89 -0
- package/packages/chili-ui/src/viewport/flyout/tip.module.css +21 -0
- package/packages/chili-ui/src/viewport/flyout/tip.ts +45 -0
- package/packages/chili-ui/src/viewport/index.ts +4 -0
- package/packages/chili-ui/src/viewport/layoutViewport.module.css +21 -0
- package/packages/chili-ui/src/viewport/layoutViewport.ts +76 -0
- package/packages/chili-ui/src/viewport/viewport.module.css +179 -0
- package/packages/chili-ui/src/viewport/viewport.ts +296 -0
- package/packages/chili-vis/package.json +9 -0
- package/packages/chili-vis/src/index.ts +7 -0
- package/packages/chili-vis/src/nodeSelectionEventHandler.ts +122 -0
- package/packages/chili-vis/src/selectionEventHandler.ts +145 -0
- package/packages/chili-vis/src/shapeSelectionEventHandler.ts +176 -0
- package/packages/chili-vis/src/viewUtils.ts +64 -0
- package/packages/chili-wasm/lib/chili-wasm.d.ts +827 -0
- package/packages/chili-wasm/lib/chili-wasm.js +5275 -0
- package/packages/chili-wasm/lib/chili-wasm.wasm +0 -0
- package/packages/chili-wasm/package.json +10 -0
- package/packages/chili-wasm/src/converter.ts +124 -0
- package/packages/chili-wasm/src/curve.ts +589 -0
- package/packages/chili-wasm/src/factory.ts +331 -0
- package/packages/chili-wasm/src/geometry.ts +51 -0
- package/packages/chili-wasm/src/helper.ts +435 -0
- package/packages/chili-wasm/src/index.ts +5 -0
- package/packages/chili-wasm/src/mesher.ts +114 -0
- package/packages/chili-wasm/src/shape.ts +481 -0
- package/packages/chili-wasm/src/surface.ts +510 -0
- package/packages/chili-wasm/src/wasm.ts +13 -0
- package/packages/chili-web/package.json +9 -0
- package/packages/chili-web/src/index.ts +33 -0
- package/packages/chili-web/src/loading.ts +67 -0
- package/packages/global.d.ts +31 -0
- package/public/favicon.svg +10 -0
- package/public/fonts/fzhei.json +46120 -0
- package/public/iconfont.js +1 -0
- package/public/images/wechat.jpg +0 -0
- package/public/index.css +13 -0
- package/public/index.html +24 -0
- package/rspack.config.ts +93 -0
- package/rstest.config.ts +27 -0
- package/screenshots/screenshot.png +0 -0
- package/scripts/add_copyright.mjs +59 -0
- package/scripts/build-npm.mjs +105 -0
- package/scripts/common.mjs +24 -0
- package/scripts/release.mjs +92 -0
- package/scripts/restore-package-json.mjs +27 -0
- package/scripts/setup_wasm_deps.mjs +97 -0
- package/scripts/update-package-json.mjs +27 -0
- package/tsconfig.build.json +14 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +19 -0
package/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Chili3D
|
|
2
|
+
|
|
3
|
+
A web-based 3D CAD application for online model design and editing.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
[Chili3D](https://chili3d.com) is an [open-source](https://github.com/xiangechen/chili3d), browser-based 3D CAD (Computer-Aided Design) application built with TypeScript. It achieves near-native performance by compiling OpenCascade (OCCT) to WebAssembly and integrating with Three.js, enabling powerful online modeling, editing, and rendering—all without the need for local installation.
|
|
10
|
+
|
|
11
|
+
You can access Chili3D online at:
|
|
12
|
+
|
|
13
|
+
- Official website: [chili3d.com](https://chili3d.com)
|
|
14
|
+
- Cloudflare deployment: [chili3d.pages.dev](https://chili3d.pages.dev)
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
### Modeling Tools
|
|
19
|
+
|
|
20
|
+
- **Basic Shapes**: Create boxes, cylinders, cones, spheres, pyramids, and more
|
|
21
|
+
- **2D Sketching**: Draw lines, arcs, circles, ellipses, rectangles, polygons, and Bezier curves
|
|
22
|
+
- **Advanced Operations**:
|
|
23
|
+
- Boolean operations (union, difference, intersection)
|
|
24
|
+
- Extrusion and revolution
|
|
25
|
+
- Sweeping and lofting
|
|
26
|
+
- Offset surfaces
|
|
27
|
+
- Section creation
|
|
28
|
+
|
|
29
|
+
### Snapping and Tracking
|
|
30
|
+
|
|
31
|
+
- **Object Snapping**: Precisely snap to geometric features (points, edges, faces)
|
|
32
|
+
- **Workplane Snapping**: Snap to the current workplane for accurate planar operations
|
|
33
|
+
- **Axis Tracking**: Create objects along tracked axes for precise alignment
|
|
34
|
+
- **Feature Point Detection**: Automatically detect and snap to key geometric features
|
|
35
|
+
- **Tracking Visualization**: Visual guides showing tracking lines and reference points
|
|
36
|
+
|
|
37
|
+
### Editing Tools
|
|
38
|
+
|
|
39
|
+
- **Modification**: Chamfer, fillet, trim, break, split
|
|
40
|
+
- **Transformation**: Move, rotate, mirror
|
|
41
|
+
- **Advanced Editing**:
|
|
42
|
+
- Feature removal
|
|
43
|
+
- Sub-shape manipulation
|
|
44
|
+
- Explode compound objects
|
|
45
|
+
|
|
46
|
+
### Measurement Tools
|
|
47
|
+
|
|
48
|
+
- Measure angles and lengths
|
|
49
|
+
- Calculate the sum of length, area, and volume
|
|
50
|
+
|
|
51
|
+
### Document Management
|
|
52
|
+
|
|
53
|
+
- Create, open, and save documents
|
|
54
|
+
- Full undo/redo stack with transaction history
|
|
55
|
+
- Import/export of industry-standard formats (STEP, IGES, BREP)
|
|
56
|
+
|
|
57
|
+
### User Interface
|
|
58
|
+
|
|
59
|
+
- Office-style interface with contextual command organization
|
|
60
|
+
- Hierarchical assembly management with flexible grouping capabilities
|
|
61
|
+
- Dynamic workplane support
|
|
62
|
+
- 3D viewport with camera controls
|
|
63
|
+
- Camera position recall
|
|
64
|
+
|
|
65
|
+
### Localization
|
|
66
|
+
|
|
67
|
+
- **Multi-Language Interface**: Built-in internationalization (i18n) supporting seamless adaptation to global user bases
|
|
68
|
+
- **Current Languages**: Chinese & English; contributions for additional languages are welcome
|
|
69
|
+
|
|
70
|
+
## Technology Stack
|
|
71
|
+
|
|
72
|
+
- **Frontend**: TypeScript, Three.js
|
|
73
|
+
- **3D Engine**: OpenCascade (via WebAssembly)
|
|
74
|
+
- **Build Tools**: Rspack
|
|
75
|
+
- **Testing**: Jest
|
|
76
|
+
|
|
77
|
+
## Change Log
|
|
78
|
+
|
|
79
|
+
You can view the full change log [here](https://github.com/xiangechen/chili3d/releases).
|
|
80
|
+
|
|
81
|
+
For Chinese users, you can also browse the [media](https://space.bilibili.com/539380032/lists/3108412?type=season).
|
|
82
|
+
|
|
83
|
+
## Getting Started
|
|
84
|
+
|
|
85
|
+
### Prerequisites
|
|
86
|
+
|
|
87
|
+
- Node.js
|
|
88
|
+
- npm
|
|
89
|
+
|
|
90
|
+
### Installation
|
|
91
|
+
|
|
92
|
+
1. Clone the repository
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
git clone https://github.com/xiangechen/chili3d.git
|
|
96
|
+
cd chili3d
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
2. Install dependencies
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npm install
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Development
|
|
106
|
+
|
|
107
|
+
Start the development server:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm run dev # Launches at http://localhost:8080
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Building
|
|
114
|
+
|
|
115
|
+
Build the application:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm run build
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Building wasm
|
|
122
|
+
|
|
123
|
+
if you want to build wasm by yourself, you can use the following commands:
|
|
124
|
+
|
|
125
|
+
1. Set up WebAssembly dependencies(if you have not installed them yet)
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm run setup:wasm
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
2. Build the WebAssembly module:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npm run build:wasm
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Development Status
|
|
138
|
+
|
|
139
|
+
⚠️ **Early Development Notice**
|
|
140
|
+
|
|
141
|
+
Chili3D is currently in active alpha development. Key considerations:
|
|
142
|
+
|
|
143
|
+
- Core APIs may undergo breaking changes
|
|
144
|
+
- Essential features are under implementation
|
|
145
|
+
- Documentation is being progressively developed
|
|
146
|
+
|
|
147
|
+
## Contributing
|
|
148
|
+
|
|
149
|
+
We welcome contributions in the form of code, bug reports, or feedback. Please feel free to submit pull requests or open issues.
|
|
150
|
+
|
|
151
|
+
## Contact
|
|
152
|
+
|
|
153
|
+
- **Discussions**: Join our [GitHub discussions](https://github.com/xiangechen/chili3d/discussions) for general chat or questions
|
|
154
|
+
- **Issues**: Use [GitHub issues](https://github.com/xiangechen/chili3d/issues) to report public suggestions or bugs
|
|
155
|
+
- **Email**: Contact us privately at xiangetg@msn.cn
|
|
156
|
+
|
|
157
|
+
## License
|
|
158
|
+
|
|
159
|
+
Distributed under the GNU Affero General Public License v3.0 (AGPL-3.0). For commercial licensing options, contact xiangetg@msn.cn
|
|
160
|
+
|
|
161
|
+
Full license details: [LICENSE](LICENSE)
|
|
162
|
+
|
|
163
|
+
## Warning
|
|
164
|
+
|
|
165
|
+
Chili3d uses [Microsoft Clarity](https://clarity.microsoft.com) for growth analytics. To disable data collection:
|
|
166
|
+
|
|
167
|
+
1. Open public/index.html
|
|
168
|
+
2. Delete lines 11-17 containing this code:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
<script type="text/javascript">
|
|
172
|
+
(function(c,l,a,r,i,t,y){
|
|
173
|
+
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
|
|
174
|
+
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
|
|
175
|
+
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
|
|
176
|
+
})(window, document, "clarity", "script", "***");
|
|
177
|
+
</script>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
This software is provided "AS IS," and the authors and contributors hereby disclaim all express and implied warranties. The user shall bear full responsibility for any and all risks and potential consequences arising from the use of this software. Such risks and consequences include, but are not limited to:
|
|
181
|
+
|
|
182
|
+
1. Data loss, system failures, or any direct or indirect damages;
|
|
183
|
+
2. Conduct violating applicable laws or regulations resulting from software usage and its consequences;
|
|
184
|
+
3. All liabilities arising from the software’s use for illegal purposes or activities.
|
package/biome.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": [
|
|
10
|
+
"**",
|
|
11
|
+
"!!**/dist",
|
|
12
|
+
"!!**/occ-wasm",
|
|
13
|
+
"!!**/public",
|
|
14
|
+
"!!**/build",
|
|
15
|
+
"!!**/coverage",
|
|
16
|
+
"!!**/lib"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"css": {
|
|
20
|
+
"parser": {
|
|
21
|
+
"cssModules": true
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"formatter": {
|
|
25
|
+
"enabled": true,
|
|
26
|
+
"indentStyle": "space",
|
|
27
|
+
"lineWidth": 110,
|
|
28
|
+
"indentWidth": 4
|
|
29
|
+
},
|
|
30
|
+
"linter": {
|
|
31
|
+
"enabled": true,
|
|
32
|
+
"rules": {
|
|
33
|
+
"recommended": true,
|
|
34
|
+
"style": {
|
|
35
|
+
"noNonNullAssertion": "warn",
|
|
36
|
+
"useTemplate": "warn"
|
|
37
|
+
},
|
|
38
|
+
"suspicious": {
|
|
39
|
+
"noExplicitAny": "warn",
|
|
40
|
+
"noImplicitAnyLet": "warn",
|
|
41
|
+
"useIterableCallbackReturn": "warn",
|
|
42
|
+
"noNonNullAssertedOptionalChain": "warn"
|
|
43
|
+
},
|
|
44
|
+
"correctness": {
|
|
45
|
+
"noUnusedFunctionParameters": "warn",
|
|
46
|
+
"noUnusedPrivateClassMembers": "warn",
|
|
47
|
+
"noUnusedVariables": "warn"
|
|
48
|
+
},
|
|
49
|
+
"complexity": {
|
|
50
|
+
"noStaticOnlyClass": "off"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"javascript": {
|
|
55
|
+
"formatter": {
|
|
56
|
+
"quoteStyle": "double"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"assist": {
|
|
60
|
+
"enabled": true,
|
|
61
|
+
"actions": {
|
|
62
|
+
"source": {
|
|
63
|
+
"organizeImports": "on"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
package/compose.yml
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
cmake_minimum_required (VERSION 3.30)
|
|
2
|
+
|
|
3
|
+
project (chili-wasm)
|
|
4
|
+
set (CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set (TARGET chili-wasm)
|
|
6
|
+
set (CMAKE_CONFIGURATION_TYPES Debug;Release)
|
|
7
|
+
set (CMAKE_NINJA_FORCE_RESPONSE_FILE 1 CACHE INTERNAL "")
|
|
8
|
+
|
|
9
|
+
get_filename_component(SOURCE_ROOT_DIR ${CMAKE_SOURCE_DIR} DIRECTORY)
|
|
10
|
+
set(CMAKE_INSTALL_PREFIX "${SOURCE_ROOT_DIR}/packages/chili-wasm/lib")
|
|
11
|
+
|
|
12
|
+
set (OcctToolkits
|
|
13
|
+
# FoundationClasses
|
|
14
|
+
TKernel TKMath
|
|
15
|
+
# ModelingData
|
|
16
|
+
TKG2d TKG3d TKGeomBase TKBRep
|
|
17
|
+
# ModelingAlgorithms
|
|
18
|
+
TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKShHealing
|
|
19
|
+
# Visualization
|
|
20
|
+
TKService TKV3d
|
|
21
|
+
# ApplicationFramework
|
|
22
|
+
TKCDF TKLCAF TKCAF TKStdL TKStd TKVCAF TKBin TKBinL TKBinXCAF
|
|
23
|
+
# DataExchange
|
|
24
|
+
TKDE TKXSBase TKXCAF TKDESTEP TKDEIGES TKDESTL
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
set (OcctUsedPackages)
|
|
28
|
+
foreach(toolkit ${OcctToolkits})
|
|
29
|
+
file (STRINGS build/occt/src/${toolkit}/PACKAGES OcctPackages)
|
|
30
|
+
list (APPEND OcctUsedPackages ${OcctPackages})
|
|
31
|
+
endforeach()
|
|
32
|
+
list (REMOVE_DUPLICATES OcctUsedPackages)
|
|
33
|
+
|
|
34
|
+
set (OcctSourceFolders)
|
|
35
|
+
set (OcctIncludeDirs)
|
|
36
|
+
foreach(package ${OcctUsedPackages})
|
|
37
|
+
if (NOT package STREQUAL "")
|
|
38
|
+
list (APPEND OcctSourceFolders build/occt/src/${package}/*.c*)
|
|
39
|
+
list (APPEND OcctIncludeDirs build/occt/src/${package})
|
|
40
|
+
endif()
|
|
41
|
+
endforeach()
|
|
42
|
+
|
|
43
|
+
include(build/occt/adm/cmake/version.cmake)
|
|
44
|
+
configure_file("build/occt/adm/templates/Standard_Version.hxx.in" "include/Standard_Version.hxx" @ONLY)
|
|
45
|
+
list (APPEND OcctIncludeDirs ${CMAKE_CURRENT_BINARY_DIR}/include)
|
|
46
|
+
|
|
47
|
+
file (GLOB OcctSourceFiles ${OcctSourceFolders})
|
|
48
|
+
|
|
49
|
+
set (ChiliWasmSourcesFolder src)
|
|
50
|
+
file (GLOB
|
|
51
|
+
ChiliWasmSourceFiles CONFIGURE_DEPENDS
|
|
52
|
+
${ChiliWasmSourcesFolder}/*.hpp
|
|
53
|
+
${ChiliWasmSourcesFolder}/*.cpp
|
|
54
|
+
)
|
|
55
|
+
source_group ("Sources" FILES ${ChiliWasmSourceFiles})
|
|
56
|
+
source_group ("OCCT" FILES ${OcctSourceFiles})
|
|
57
|
+
|
|
58
|
+
if (${EMSCRIPTEN})
|
|
59
|
+
|
|
60
|
+
add_library(occt STATIC ${OcctSourceFiles})
|
|
61
|
+
target_include_directories (occt PUBLIC ${OcctIncludeDirs})
|
|
62
|
+
target_compile_options (occt PUBLIC
|
|
63
|
+
$<$<CONFIG:Release>:-Os>
|
|
64
|
+
$<$<CONFIG:Release>:-flto>
|
|
65
|
+
$<IF:$<CONFIG:Release>,-sDISABLE_EXCEPTION_CATCHING=1,-sDISABLE_EXCEPTION_CATCHING=0>
|
|
66
|
+
-DOCCT_NO_PLUGINS
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
add_executable (${TARGET} ${ChiliWasmSourceFiles})
|
|
70
|
+
target_include_directories (${TARGET} PUBLIC ${OcctIncludeDirs})
|
|
71
|
+
target_compile_options (${TARGET} PUBLIC
|
|
72
|
+
$<$<CONFIG:Release>:-Os>
|
|
73
|
+
$<$<CONFIG:Release>:-flto>
|
|
74
|
+
$<IF:$<CONFIG:Release>,-sDISABLE_EXCEPTION_CATCHING=1,-sDISABLE_EXCEPTION_CATCHING=0>
|
|
75
|
+
)
|
|
76
|
+
target_link_libraries(${TARGET} PUBLIC occt)
|
|
77
|
+
target_link_options (${TARGET} PUBLIC
|
|
78
|
+
$<IF:$<CONFIG:Release>,-Os,-O0>
|
|
79
|
+
$<IF:$<CONFIG:Release>,-flto,-fno-lto>
|
|
80
|
+
$<IF:$<CONFIG:Release>,-sDISABLE_EXCEPTION_CATCHING=1,-sDISABLE_EXCEPTION_CATCHING=0>
|
|
81
|
+
-sMODULARIZE=1
|
|
82
|
+
-sEXPORT_ES6=1
|
|
83
|
+
-sSTACK_SIZE=8MB
|
|
84
|
+
-sINITIAL_HEAP=64MB
|
|
85
|
+
-sALLOW_MEMORY_GROWTH=1
|
|
86
|
+
-sMAXIMUM_MEMORY=4GB
|
|
87
|
+
-sENVIRONMENT="web"
|
|
88
|
+
--bind
|
|
89
|
+
--emit-tsd "${TARGET}.d.ts"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
install(TARGETS ${TARGET} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
|
93
|
+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.wasm DESTINATION ${CMAKE_INSTALL_PREFIX})
|
|
94
|
+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.d.ts DESTINATION ${CMAKE_INSTALL_PREFIX})
|
|
95
|
+
|
|
96
|
+
endif ()
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"configurePresets": [
|
|
4
|
+
{
|
|
5
|
+
"name": "default",
|
|
6
|
+
"generator": "Ninja",
|
|
7
|
+
"hidden": true,
|
|
8
|
+
"toolchainFile": "build/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "debug",
|
|
12
|
+
"inherits": "default",
|
|
13
|
+
"displayName": "Emscripten Debug",
|
|
14
|
+
"binaryDir": "build/target/debug",
|
|
15
|
+
"cacheVariables": {
|
|
16
|
+
"CMAKE_BUILD_TYPE": "Debug"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "release",
|
|
21
|
+
"inherits": "default",
|
|
22
|
+
"displayName": "Emscripten Release",
|
|
23
|
+
"binaryDir": "build/target/release",
|
|
24
|
+
"cacheVariables": {
|
|
25
|
+
"CMAKE_BUILD_TYPE": "Release"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"buildPresets": [
|
|
30
|
+
{
|
|
31
|
+
"name": "debug",
|
|
32
|
+
"configurePreset": "debug",
|
|
33
|
+
"configuration": "Debug",
|
|
34
|
+
"targets": ["install"]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"name": "release",
|
|
38
|
+
"configurePreset": "release",
|
|
39
|
+
"configuration": "Release",
|
|
40
|
+
"targets": ["install"]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
package/cpp/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# chili3d's WebAssembly Module
|
|
2
|
+
|
|
3
|
+
## Clone and install all dependencies
|
|
4
|
+
|
|
5
|
+
When compiling for the first time, or if the build directory has been deleted or dependencies have been updated, please execute this command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run setup:wasm
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
If you see **Setup complete**, it means it was successful. Otherwise, please check the logs and try again.
|
|
12
|
+
|
|
13
|
+
## Compile
|
|
14
|
+
|
|
15
|
+
To build the current project, please execute
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run build:wasm
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
After the compilation is completed, the target will be copied to the **packages/chili-wasm/lib** directory.
|