@pinkaphant/kolmo 0.2.3 → 0.4.0
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/LICENSE +1 -1
- package/README.md +36 -36
- package/bin/kolmo.mjs +12 -6
- package/dist/engine/causewayBridge.d.ts +14 -0
- package/dist/engine/causewayBridge.js +166 -0
- package/dist/engine/causewayBridge.js.map +1 -0
- package/dist/engine/index.d.ts +6 -4
- package/dist/engine/index.js +19 -12
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/islandSettlementMesh.d.ts +26 -0
- package/dist/engine/islandSettlementMesh.js +166 -0
- package/dist/engine/islandSettlementMesh.js.map +1 -0
- package/dist/engine/kolmoActions.d.ts +23 -0
- package/dist/engine/kolmoActions.js +164 -0
- package/dist/engine/kolmoActions.js.map +1 -0
- package/dist/engine/kolmoActor.js +242 -165
- package/dist/engine/kolmoActor.js.map +1 -0
- package/dist/engine/kolmoFloatingOrigin.d.ts +17 -0
- package/dist/engine/kolmoFloatingOrigin.js +98 -0
- package/dist/engine/kolmoFloatingOrigin.js.map +1 -0
- package/dist/engine/kolmoGame.d.ts +27 -0
- package/dist/engine/kolmoGame.js +80 -0
- package/dist/engine/kolmoGame.js.map +1 -0
- package/dist/engine/kolmoHud.d.ts +23 -0
- package/dist/engine/kolmoHud.js +195 -0
- package/dist/engine/kolmoHud.js.map +1 -0
- package/dist/engine/kolmoInput.d.ts +1 -1
- package/dist/engine/kolmoInput.js +57 -30
- package/dist/engine/kolmoInput.js.map +1 -0
- package/dist/engine/kolmoIsland.d.ts +5 -10
- package/dist/engine/kolmoIsland.js +182 -250
- package/dist/engine/kolmoIsland.js.map +1 -0
- package/dist/engine/kolmoLongDrive.d.ts +3 -4
- package/dist/engine/kolmoLongDrive.js +140 -205
- package/dist/engine/kolmoLongDrive.js.map +1 -0
- package/dist/engine/kolmoPilotMesh.d.ts +2 -0
- package/dist/engine/kolmoPilotMesh.js +64 -0
- package/dist/engine/kolmoPilotMesh.js.map +1 -0
- package/dist/engine/kolmoProcedural.d.ts +13 -0
- package/dist/engine/kolmoProcedural.js +101 -0
- package/dist/engine/kolmoProcedural.js.map +1 -0
- package/dist/engine/kolmoRigs.d.ts +1 -1
- package/dist/engine/kolmoRigs.js +88 -47
- package/dist/engine/kolmoRigs.js.map +1 -0
- package/dist/engine/kolmoStore.d.ts +3 -100
- package/dist/engine/kolmoSurface.d.ts +2 -2
- package/dist/engine/kolmoSurface.js +150 -134
- package/dist/engine/kolmoSurface.js.map +1 -0
- package/dist/engine/kolmoTraits.d.ts +128 -0
- package/dist/engine/kolmoTraits.js +140 -0
- package/dist/engine/kolmoTraits.js.map +1 -0
- package/dist/engine/kolmoVehicle.d.ts +3 -33
- package/dist/engine/kolmoVehicle.js +66 -240
- package/dist/engine/kolmoVehicle.js.map +1 -0
- package/dist/engine/kolmoVehicleConfig.d.ts +54 -0
- package/dist/engine/kolmoVehicleConfig.js +80 -0
- package/dist/engine/kolmoVehicleConfig.js.map +1 -0
- package/dist/engine/kolmoVehicleDriver.d.ts +4 -1
- package/dist/engine/kolmoVehicleDriver.js +116 -22
- package/dist/engine/kolmoVehicleDriver.js.map +1 -0
- package/dist/engine/kolmoVehicleInner.d.ts +7 -0
- package/dist/engine/kolmoVehicleInner.js +261 -0
- package/dist/engine/kolmoVehicleInner.js.map +1 -0
- package/dist/engine/kolmoWorld.d.ts +6 -4
- package/dist/engine/kolmoWorld.js +134 -116
- package/dist/engine/kolmoWorld.js.map +1 -0
- package/dist/engine/longDriveKit.d.ts +5 -12
- package/dist/engine/longDriveKit.js +121 -233
- package/dist/engine/longDriveKit.js.map +1 -0
- package/dist/engine/longDriveRoadside.d.ts +16 -0
- package/dist/engine/longDriveRoadside.js +171 -0
- package/dist/engine/longDriveRoadside.js.map +1 -0
- package/dist/engine/macroCellBuilder.d.ts +34 -0
- package/dist/engine/macroCellBuilder.js +145 -0
- package/dist/engine/macroCellBuilder.js.map +1 -0
- package/dist/engine/mainlandMacroCell.d.ts +2 -2
- package/dist/engine/mainlandMacroCell.js +77 -165
- package/dist/engine/mainlandMacroCell.js.map +1 -0
- package/dist/engine/shiftedFixedBody.d.ts +1 -1
- package/dist/engine/shiftedFixedBody.js +55 -28
- package/dist/engine/shiftedFixedBody.js.map +1 -0
- package/dist/importer/ChopShopPanel.d.ts +9 -1
- package/dist/importer/ChopShopPanel.js +303 -359
- package/dist/importer/ChopShopPanel.js.map +1 -0
- package/dist/importer/DomainWorkshopPanel.d.ts +2 -1
- package/dist/importer/DomainWorkshopPanel.js +172 -242
- package/dist/importer/DomainWorkshopPanel.js.map +1 -0
- package/dist/importer/GateHudBar.d.ts +8 -0
- package/dist/importer/GateHudBar.js +290 -279
- package/dist/importer/GateHudBar.js.map +1 -0
- package/dist/importer/GlbImportGate.d.ts +2 -1
- package/dist/importer/GlbImportGate.js +252 -225
- package/dist/importer/GlbImportGate.js.map +1 -0
- package/dist/importer/ImperativeVehicleRig.d.ts +2 -2
- package/dist/importer/ImperativeVehicleRig.js +223 -284
- package/dist/importer/ImperativeVehicleRig.js.map +1 -0
- package/dist/importer/LiveDrivePads.d.ts +20 -0
- package/dist/importer/LiveDrivePads.js +169 -0
- package/dist/importer/LiveDrivePads.js.map +1 -0
- package/dist/importer/PaperShellDebrisRig.d.ts +25 -0
- package/dist/importer/PaperShellDebrisRig.js +143 -0
- package/dist/importer/PaperShellDebrisRig.js.map +1 -0
- package/dist/importer/R2VaultDrawer.d.ts +12 -0
- package/dist/importer/R2VaultDrawer.js +90 -0
- package/dist/importer/R2VaultDrawer.js.map +1 -0
- package/dist/importer/Step1CalibrationPlinth.d.ts +23 -5
- package/dist/importer/Step1CalibrationPlinth.js +180 -251
- package/dist/importer/Step1CalibrationPlinth.js.map +1 -0
- package/dist/importer/Step1ExplodedIslands.d.ts +31 -0
- package/dist/importer/Step1ExplodedIslands.js +144 -0
- package/dist/importer/Step1ExplodedIslands.js.map +1 -0
- package/dist/importer/Step2UniversalPad.d.ts +7 -7
- package/dist/importer/Step2UniversalPad.js +49 -170
- package/dist/importer/Step2UniversalPad.js.map +1 -0
- package/dist/importer/VfxEmitterPool.js +59 -86
- package/dist/importer/VfxEmitterPool.js.map +1 -0
- package/dist/importer/WheelRingHandles3D.d.ts +11 -0
- package/dist/importer/WheelRingHandles3D.js +318 -0
- package/dist/importer/WheelRingHandles3D.js.map +1 -0
- package/dist/importer/archLinerGeom.d.ts +2 -0
- package/dist/importer/archLinerGeom.js +51 -0
- package/dist/importer/archLinerGeom.js.map +1 -0
- package/dist/importer/{vehiclePanelAnim.d.ts → chopHingeHelpers.d.ts} +0 -10
- package/dist/importer/chopHingeHelpers.js +193 -0
- package/dist/importer/chopHingeHelpers.js.map +1 -0
- package/dist/importer/chopShopActions.d.ts +20 -26
- package/dist/importer/chopShopActions.js +135 -210
- package/dist/importer/chopShopActions.js.map +1 -0
- package/dist/importer/chopShopHandlers.d.ts +26 -0
- package/dist/importer/chopShopHandlers.js +276 -0
- package/dist/importer/chopShopHandlers.js.map +1 -0
- package/dist/importer/chopShopIoActions.d.ts +15 -0
- package/dist/importer/chopShopIoActions.js +137 -0
- package/dist/importer/chopShopIoActions.js.map +1 -0
- package/dist/importer/chopShopMcpAction.d.ts +18 -0
- package/dist/importer/chopShopMcpAction.js +58 -0
- package/dist/importer/chopShopMcpAction.js.map +1 -0
- package/dist/importer/cylinderBooleanSlice.d.ts +14 -0
- package/dist/importer/cylinderBooleanSlice.js +110 -0
- package/dist/importer/cylinderBooleanSlice.js.map +1 -0
- package/dist/importer/cylinderSliceMath.d.ts +14 -0
- package/dist/importer/cylinderSliceMath.js +251 -0
- package/dist/importer/cylinderSliceMath.js.map +1 -0
- package/dist/importer/fusedWheelDetect.d.ts +4 -0
- package/dist/importer/fusedWheelDetect.js +175 -0
- package/dist/importer/fusedWheelDetect.js.map +1 -0
- package/dist/importer/fusedWheelFit.d.ts +13 -0
- package/dist/importer/fusedWheelFit.js +138 -0
- package/dist/importer/fusedWheelFit.js.map +1 -0
- package/dist/importer/gateStore.d.ts +1 -1
- package/dist/importer/gateStore.js +36 -27
- package/dist/importer/gateStore.js.map +1 -0
- package/dist/importer/glbNormalizer.js +118 -79
- package/dist/importer/glbNormalizer.js.map +1 -0
- package/dist/importer/importerWebMcp.d.ts +4 -3
- package/dist/importer/importerWebMcp.js +41 -336
- package/dist/importer/importerWebMcp.js.map +1 -0
- package/dist/importer/importerWebMcpTools.d.ts +2 -0
- package/dist/importer/importerWebMcpTools.js +340 -0
- package/dist/importer/importerWebMcpTools.js.map +1 -0
- package/dist/importer/index.d.ts +4 -0
- package/dist/importer/index.js +32 -22
- package/dist/importer/index.js.map +1 -0
- package/dist/importer/khrCarPlanHelpers.d.ts +28 -0
- package/dist/importer/khrCarPlanHelpers.js +221 -0
- package/dist/importer/khrCarPlanHelpers.js.map +1 -0
- package/dist/importer/khrCarPlanner.d.ts +7 -0
- package/dist/importer/khrCarPlanner.js +279 -0
- package/dist/importer/khrCarPlanner.js.map +1 -0
- package/dist/importer/khrCompiler.d.ts +4 -22
- package/dist/importer/khrCompiler.js +56 -424
- package/dist/importer/khrCompiler.js.map +1 -0
- package/dist/importer/khrCraftPropCompiler.d.ts +40 -0
- package/dist/importer/khrCraftPropCompiler.js +250 -0
- package/dist/importer/khrCraftPropCompiler.js.map +1 -0
- package/dist/importer/launcherBake.js +76 -35
- package/dist/importer/launcherBake.js.map +1 -0
- package/dist/importer/meshIslands.d.ts +4 -46
- package/dist/importer/meshIslands.js +84 -283
- package/dist/importer/meshIslands.js.map +1 -0
- package/dist/importer/meshSliceBuffers.d.ts +15 -0
- package/dist/importer/meshSliceBuffers.js +159 -0
- package/dist/importer/meshSliceBuffers.js.map +1 -0
- package/dist/importer/polygonEarClipYZ.d.ts +3 -0
- package/dist/importer/polygonEarClipYZ.js +67 -0
- package/dist/importer/polygonEarClipYZ.js.map +1 -0
- package/dist/importer/sceneSiNormalize.d.ts +19 -0
- package/dist/importer/sceneSiNormalize.js +138 -0
- package/dist/importer/sceneSiNormalize.js.map +1 -0
- package/dist/importer/starterScene.d.ts +3 -0
- package/dist/importer/starterScene.js +76 -0
- package/dist/importer/starterScene.js.map +1 -0
- package/dist/importer/surfaceCutter.d.ts +4 -15
- package/dist/importer/surfaceCutter.js +69 -240
- package/dist/importer/surfaceCutter.js.map +1 -0
- package/dist/importer/surfaceGeodesic.d.ts +7 -0
- package/dist/importer/surfaceGeodesic.js +130 -0
- package/dist/importer/surfaceGeodesic.js.map +1 -0
- package/dist/importer/surfaceLoopRefine.d.ts +6 -0
- package/dist/importer/surfaceLoopRefine.js +171 -0
- package/dist/importer/surfaceLoopRefine.js.map +1 -0
- package/dist/importer/surfacePeel.d.ts +11 -0
- package/dist/importer/surfacePeel.js +119 -0
- package/dist/importer/surfacePeel.js.map +1 -0
- package/dist/importer/surfaceTopology.d.ts +2 -6
- package/dist/importer/surfaceTopology.js +93 -133
- package/dist/importer/surfaceTopology.js.map +1 -0
- package/dist/importer/universalGateBake.d.ts +7 -3
- package/dist/importer/universalGateBake.js +104 -106
- package/dist/importer/universalGateBake.js.map +1 -0
- package/dist/importer/usdPhysicsSpecs.d.ts +3 -0
- package/dist/importer/usdPhysicsSpecs.js +245 -0
- package/dist/importer/usdPhysicsSpecs.js.map +1 -0
- package/dist/importer/usdTextParse.d.ts +12 -0
- package/dist/importer/usdTextParse.js +118 -0
- package/dist/importer/usdTextParse.js.map +1 -0
- package/dist/importer/usdToGlb.d.ts +3 -2
- package/dist/importer/usdToGlb.js +80 -280
- package/dist/importer/usdToGlb.js.map +1 -0
- package/dist/importer/useChopShopController.d.ts +50 -47
- package/dist/importer/useChopShopController.js +156 -338
- package/dist/importer/useChopShopController.js.map +1 -0
- package/dist/importer/useChopShopState.d.ts +103 -0
- package/dist/importer/useChopShopState.js +319 -0
- package/dist/importer/useChopShopState.js.map +1 -0
- package/dist/importer/useWasdKeyRef.d.ts +9 -0
- package/dist/importer/useWasdKeyRef.js +35 -0
- package/dist/importer/useWasdKeyRef.js.map +1 -0
- package/dist/importer/vehiclePartSplit.d.ts +33 -0
- package/dist/importer/vehiclePartSplit.js +178 -0
- package/dist/importer/vehiclePartSplit.js.map +1 -0
- package/dist/importer/wheelAxlePairing.js +106 -70
- package/dist/importer/wheelAxlePairing.js.map +1 -0
- package/dist/importer/wheelCutterHelpers.d.ts +42 -0
- package/dist/importer/wheelCutterHelpers.js +178 -0
- package/dist/importer/wheelCutterHelpers.js.map +1 -0
- package/dist/importer/wheelRingHandleMath.d.ts +20 -0
- package/dist/importer/wheelRingHandleMath.js +66 -0
- package/dist/importer/wheelRingHandleMath.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +90 -66
- package/dist/index.js.map +1 -0
- package/dist/junk/DestructibleTarget.d.ts +3 -3
- package/dist/junk/DestructibleTarget.js +177 -114
- package/dist/junk/DestructibleTarget.js.map +1 -0
- package/dist/junk/KolmoJunk.js +55 -44
- package/dist/junk/KolmoJunk.js.map +1 -0
- package/dist/junk/ShardPieces.d.ts +2 -1
- package/dist/junk/ShardPieces.js +80 -61
- package/dist/junk/ShardPieces.js.map +1 -0
- package/dist/junk/TargetDecals.d.ts +6 -15
- package/dist/junk/TargetDecals.js +66 -40
- package/dist/junk/TargetDecals.js.map +1 -0
- package/dist/junk/bvhShatter.d.ts +2 -6
- package/dist/junk/bvhShatter.js +89 -43
- package/dist/junk/bvhShatter.js.map +1 -0
- package/dist/junk/bvhTriCollector.d.ts +2 -6
- package/dist/junk/bvhTriCollector.js +111 -62
- package/dist/junk/bvhTriCollector.js.map +1 -0
- package/dist/junk/index.d.ts +2 -2
- package/dist/junk/index.js +11 -11
- package/dist/junk/index.js.map +1 -0
- package/dist/junk/junkGeometry.d.ts +5 -26
- package/dist/junk/junkGeometry.js +61 -43
- package/dist/junk/junkGeometry.js.map +1 -0
- package/dist/junk/junkImportSanitize.d.ts +4 -5
- package/dist/junk/junkImportSanitize.js +57 -37
- package/dist/junk/junkImportSanitize.js.map +1 -0
- package/dist/junk/junkImporter.d.ts +2 -13
- package/dist/junk/junkImporter.js +105 -76
- package/dist/junk/junkImporter.js.map +1 -0
- package/dist/junk/junkLabelCanvas.d.ts +1 -6
- package/dist/junk/junkLabelCanvas.js +147 -29
- package/dist/junk/junkLabelCanvas.js.map +1 -0
- package/dist/junk/junkLabels.d.ts +4 -26
- package/dist/junk/junkLabels.js +42 -28
- package/dist/junk/junkLabels.js.map +1 -0
- package/dist/junk/targetHelpers.d.ts +3 -4
- package/dist/junk/targetHelpers.js +121 -67
- package/dist/junk/targetHelpers.js.map +1 -0
- package/dist/junk/targetHitLogic.d.ts +8 -8
- package/dist/junk/targetHitLogic.js +131 -95
- package/dist/junk/targetHitLogic.js.map +1 -0
- package/dist/junk/useTargetAssets.d.ts +9 -14
- package/dist/junk/useTargetAssets.js +113 -85
- package/dist/junk/useTargetAssets.js.map +1 -0
- package/dist/physics/index.d.ts +1 -1
- package/dist/physics/index.js +79 -58
- package/dist/physics/index.js.map +1 -0
- package/dist/schema/kolmoSchema.d.ts +3 -64
- package/dist/schema/kolmoSchema.js +75 -149
- package/dist/schema/kolmoSchema.js.map +1 -0
- package/dist/schema/kolmoStamp.d.ts +6 -0
- package/dist/schema/kolmoStamp.js +71 -0
- package/dist/schema/kolmoStamp.js.map +1 -0
- package/dist/schema/kolmoTypes.d.ts +63 -0
- package/dist/schema/kolmoTypes.js +66 -0
- package/dist/schema/kolmoTypes.js.map +1 -0
- package/dist/shaders/celestialBackdrop.d.ts +2 -10
- package/dist/shaders/celestialBackdrop.js +128 -291
- package/dist/shaders/celestialBackdrop.js.map +1 -0
- package/dist/shaders/emitterShaders.d.ts +9 -0
- package/dist/shaders/emitterShaders.js +114 -0
- package/dist/shaders/emitterShaders.js.map +1 -0
- package/dist/shaders/index.d.ts +1 -1
- package/dist/shaders/index.js +12 -9
- package/dist/shaders/index.js.map +1 -0
- package/dist/shaders/plumeAndSparkle.d.ts +2 -4
- package/dist/shaders/plumeAndSparkle.js +152 -191
- package/dist/shaders/plumeAndSparkle.js.map +1 -0
- package/dist/shaders/ps2GlslShared.js +29 -2
- package/dist/shaders/ps2GlslShared.js.map +1 -0
- package/dist/shaders/ps2MaterialsTSL.js +132 -51
- package/dist/shaders/ps2MaterialsTSL.js.map +1 -0
- package/dist/shaders/ps2MaterialsWebGL.js +45 -28
- package/dist/shaders/ps2MaterialsWebGL.js.map +1 -0
- package/dist/shaders/ps2RoadWebGL.js +69 -32
- package/dist/shaders/ps2RoadWebGL.js.map +1 -0
- package/dist/shaders/ps2TerrainWebGL.js +107 -30
- package/dist/shaders/ps2TerrainWebGL.js.map +1 -0
- package/dist/shaders/ps2Textures.d.ts +1 -1
- package/dist/shaders/ps2Textures.js +116 -41
- package/dist/shaders/ps2Textures.js.map +1 -0
- package/dist/shaders/retroPalettes.d.ts +1 -1
- package/dist/shaders/retroPalettes.js +90 -57
- package/dist/shaders/retroPalettes.js.map +1 -0
- package/dist/shaders/retroShader.d.ts +2 -86
- package/dist/shaders/retroShader.js +65 -196
- package/dist/shaders/retroShader.js.map +1 -0
- package/dist/shaders/retroUniforms.d.ts +60 -0
- package/dist/shaders/retroUniforms.js +215 -0
- package/dist/shaders/retroUniforms.js.map +1 -0
- package/dist/shaders/skyboxShaders.d.ts +16 -0
- package/dist/shaders/skyboxShaders.js +266 -0
- package/dist/shaders/skyboxShaders.js.map +1 -0
- package/dist/shaders/tsl.d.ts +1 -1
- package/dist/shaders/tsl.js.map +1 -0
- package/dist/vite/index.js +39 -23
- package/dist/vite/index.js.map +1 -0
- package/dist/world/frontage.js +25 -21
- package/dist/world/frontage.js.map +1 -0
- package/dist/world/index.d.ts +4 -4
- package/dist/world/index.js +12 -11
- package/dist/world/index.js.map +1 -0
- package/dist/world/infiniteWorld2D.d.ts +0 -5
- package/dist/world/infiniteWorld2D.js +175 -200
- package/dist/world/infiniteWorld2D.js.map +1 -0
- package/dist/world/island.js +81 -166
- package/dist/world/island.js.map +1 -0
- package/dist/world/islandPathing.d.ts +6 -0
- package/dist/world/islandPathing.js +166 -0
- package/dist/world/islandPathing.js.map +1 -0
- package/dist/world/macroCellSchema.js +15 -8
- package/dist/world/macroCellSchema.js.map +1 -0
- package/dist/world/macroKnightAStar.js +140 -71
- package/dist/world/macroKnightAStar.js.map +1 -0
- package/dist/world/macroSettlementZones.d.ts +9 -0
- package/dist/world/macroSettlementZones.js +108 -0
- package/dist/world/macroSettlementZones.js.map +1 -0
- package/dist/world/random.js +50 -24
- package/dist/world/random.js.map +1 -0
- package/dist/world/road.js +152 -90
- package/dist/world/road.js.map +1 -0
- package/dist/world/roadRibbon.d.ts +4 -19
- package/dist/world/roadRibbon.js +129 -124
- package/dist/world/roadRibbon.js.map +1 -0
- package/dist/world/terrain.d.ts +1 -1
- package/dist/world/terrain.js +111 -65
- package/dist/world/terrain.js.map +1 -0
- package/dist/world/terrainGeometry.d.ts +14 -0
- package/dist/world/terrainGeometry.js +76 -0
- package/dist/world/terrainGeometry.js.map +1 -0
- package/dist/world/worldTypes.d.ts +3 -3
- package/dist/world/worldTypes.js +133 -67
- package/dist/world/worldTypes.js.map +1 -0
- package/docs/api-reference.md +187 -0
- package/package.json +58 -32
- package/dist/engine/kolmoStore.js +0 -211
- package/dist/importer/ImporterPlinthUikitTags.d.ts +0 -19
- package/dist/importer/ImporterPlinthUikitTags.js +0 -112
- package/dist/importer/vehiclePanelAnim.js +0 -214
|
@@ -1,301 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { bakeGeometryTransform, isMeshObject, normalizeSceneToSi, primaryMatOf, sliceMeshTriangles } from "./sceneSiNormalize.js";
|
|
2
|
+
import { separateVehicleMeshes } from "./vehiclePartSplit.js";
|
|
3
|
+
import { measureSelection, suggestCarAxles, toggleIslandSelection } from "./wheelAxlePairing.js";
|
|
4
|
+
import * as THREE from "three";
|
|
3
5
|
// src/importer/meshIslands.ts
|
|
4
|
-
var
|
|
6
|
+
var UnionFind = class {
|
|
5
7
|
p;
|
|
6
|
-
constructor(
|
|
7
|
-
this.p = new Int32Array(
|
|
8
|
-
for (let
|
|
8
|
+
constructor(n) {
|
|
9
|
+
this.p = new Int32Array(n);
|
|
10
|
+
for (let i = 0; i < n; i++) this.p[i] = i;
|
|
9
11
|
}
|
|
10
|
-
find(
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
for (let
|
|
14
|
-
|
|
15
|
-
this.p[
|
|
12
|
+
find(x) {
|
|
13
|
+
let root = x;
|
|
14
|
+
while (this.p[root] !== root) root = this.p[root];
|
|
15
|
+
for (let cur = x; cur !== root;) {
|
|
16
|
+
const next = this.p[cur];
|
|
17
|
+
this.p[cur] = root;
|
|
18
|
+
cur = next;
|
|
16
19
|
}
|
|
17
|
-
return
|
|
20
|
+
return root;
|
|
18
21
|
}
|
|
19
|
-
union(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
union(a, b) {
|
|
23
|
+
const ra = this.find(a), rb = this.find(b);
|
|
24
|
+
if (ra !== rb) this.p[rb] = ra;
|
|
22
25
|
}
|
|
23
|
-
}
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
], i = t.axis ?? "lengthZ";
|
|
49
|
-
if (!(t.targetMeters > 0)) throw Error(`normalizeSceneToSi: invalid targetMeters ${t.targetMeters}`);
|
|
50
|
-
let a = e.clone(!0), s = new r.Group();
|
|
51
|
-
s.quaternion.setFromEuler(new r.Euler(n[0] * Math.PI * .5, n[1] * Math.PI * .5, n[2] * Math.PI * .5, "XYZ")), s.add(a), s.updateMatrixWorld(!0);
|
|
52
|
-
let c = new r.Box3().setFromObject(s);
|
|
53
|
-
if (c.isEmpty()) throw Error("normalizeSceneToSi: empty scene bounds");
|
|
54
|
-
let l = c.getSize(new r.Vector3()), u = c.getCenter(new r.Vector3()), d = i === "widthX" ? l.x : i === "heightY" ? l.y : i === "lengthZ" ? l.z : Math.max(l.x, l.y, l.z), f = t.targetMeters / Math.max(d, 1e-5), p = new r.Matrix4().makeTranslation(-u.x * f, -c.min.y * f, -u.z * f).multiply(new r.Matrix4().makeScale(f, f, f)), m = new r.Group();
|
|
55
|
-
m.name = e.name || "KolmoAsset";
|
|
56
|
-
let h = new r.Matrix4(), g = new r.Vector3();
|
|
57
|
-
a.traverse((e) => {
|
|
58
|
-
if (e !== a) {
|
|
59
|
-
if (e instanceof r.Mesh && e.geometry) {
|
|
60
|
-
let t = new r.Mesh(o(e.geometry, h.multiplyMatrices(p, e.matrixWorld)), e.material);
|
|
61
|
-
t.name = e.name, t.userData = { ...e.userData }, m.add(t);
|
|
62
|
-
} else if (e.children.length === 0 && e.name) {
|
|
63
|
-
let t = new r.Object3D();
|
|
64
|
-
t.name = e.name, t.userData = { ...e.userData }, t.position.copy(e.getWorldPosition(g).applyMatrix4(p)), m.add(t);
|
|
65
|
-
}
|
|
26
|
+
};
|
|
27
|
+
function extractMeshIslands(normalizedScene, weldTolerance = 1e-4) {
|
|
28
|
+
const invTol = 1 / Math.max(1e-7, weldTolerance);
|
|
29
|
+
normalizedScene.updateMatrixWorld(true);
|
|
30
|
+
const invRoot = new THREE.Matrix4().copy(normalizedScene.matrixWorld).invert();
|
|
31
|
+
const relMat = new THREE.Matrix4();
|
|
32
|
+
const islands = [];
|
|
33
|
+
let nextId = 0;
|
|
34
|
+
normalizedScene.traverse((obj) => {
|
|
35
|
+
if (!isMeshObject(obj)) return;
|
|
36
|
+
const pos = obj.geometry.getAttribute("position");
|
|
37
|
+
if (!pos || pos.count < 3) return;
|
|
38
|
+
const baked = bakeGeometryTransform(obj.geometry, relMat.multiplyMatrices(invRoot, obj.matrixWorld));
|
|
39
|
+
const bPos = baked.getAttribute("position");
|
|
40
|
+
const index = baked.getIndex();
|
|
41
|
+
const triCount = Math.floor((index ? index.count : bPos.count) / 3);
|
|
42
|
+
if (triCount === 0) return;
|
|
43
|
+
const uf = new UnionFind(triCount);
|
|
44
|
+
const vertToTri = /* @__PURE__ */ new Map();
|
|
45
|
+
for (let t = 0; t < triCount; t++) for (let c = 0; c < 3; c++) {
|
|
46
|
+
const vi = index ? index.getX(t * 3 + c) : t * 3 + c;
|
|
47
|
+
const vKey = `${Math.round(bPos.getX(vi) * invTol)},${Math.round(bPos.getY(vi) * invTol)},${Math.round(bPos.getZ(vi) * invTol)}`;
|
|
48
|
+
const prevTri = vertToTri.get(vKey);
|
|
49
|
+
if (prevTri === void 0) vertToTri.set(vKey, t);
|
|
50
|
+
else uf.union(t, prevTri);
|
|
66
51
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
_.z
|
|
75
|
-
],
|
|
76
|
-
scaleApplied: f
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function c(e, t, n = [
|
|
80
|
-
0,
|
|
81
|
-
0,
|
|
82
|
-
0
|
|
83
|
-
]) {
|
|
84
|
-
let i = e.getIndex(), a = t.length, o = new r.BufferGeometry();
|
|
85
|
-
for (let s of Object.keys(e.attributes)) {
|
|
86
|
-
let c = e.getAttribute(s);
|
|
87
|
-
if (!c) continue;
|
|
88
|
-
let l = c.itemSize, u = new Float32Array(a * 3 * l), d = s === "position";
|
|
89
|
-
for (let e = 0; e < a; e++) {
|
|
90
|
-
let r = t[e];
|
|
91
|
-
for (let t = 0; t < 3; t++) {
|
|
92
|
-
let a = i ? i.getX(r * 3 + t) : r * 3 + t, o = (e * 3 + t) * l;
|
|
93
|
-
if (d) u[o] = c.getX(a) + n[0], u[o + 1] = c.getY(a) + n[1], u[o + 2] = c.getZ(a) + n[2];
|
|
94
|
-
else for (let e = 0; e < l; e++) u[o + e] = c.getComponent(a, e);
|
|
52
|
+
const groups = /* @__PURE__ */ new Map();
|
|
53
|
+
for (let t = 0; t < triCount; t++) {
|
|
54
|
+
const root = uf.find(t);
|
|
55
|
+
let list = groups.get(root);
|
|
56
|
+
if (!list) {
|
|
57
|
+
list = [];
|
|
58
|
+
groups.set(root, list);
|
|
95
59
|
}
|
|
60
|
+
list.push(t);
|
|
96
61
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
let g = new i(h), _ = /* @__PURE__ */ new Map();
|
|
112
|
-
for (let e = 0; e < h; e++) for (let t = 0; t < 3; t++) {
|
|
113
|
-
let r = m ? m.getX(e * 3 + t) : e * 3 + t, i = `${Math.round(p.getX(r) * n)},${Math.round(p.getY(r) * n)},${Math.round(p.getZ(r) * n)}`, a = _.get(i);
|
|
114
|
-
a === void 0 ? _.set(i, e) : g.union(e, a);
|
|
115
|
-
}
|
|
116
|
-
let v = /* @__PURE__ */ new Map();
|
|
117
|
-
for (let e = 0; e < h; e++) {
|
|
118
|
-
let t = g.find(e), n = v.get(t);
|
|
119
|
-
n || (n = [], v.set(t, n)), n.push(e);
|
|
120
|
-
}
|
|
121
|
-
let y = a(e);
|
|
122
|
-
for (let t of v.values()) {
|
|
123
|
-
let n = new Uint32Array(t), r = c(f, n), i = r.boundingBox, a = [
|
|
124
|
-
i.min.x,
|
|
125
|
-
i.min.y,
|
|
126
|
-
i.min.z
|
|
127
|
-
], o = [
|
|
128
|
-
i.max.x,
|
|
129
|
-
i.max.y,
|
|
130
|
-
i.max.z
|
|
62
|
+
const mat = primaryMatOf(obj);
|
|
63
|
+
for (const triList of groups.values()) {
|
|
64
|
+
const triIndices = new Uint32Array(triList);
|
|
65
|
+
const subGeo = sliceMeshTriangles(baked, triIndices);
|
|
66
|
+
const bb = subGeo.boundingBox;
|
|
67
|
+
const min = [
|
|
68
|
+
bb.min.x,
|
|
69
|
+
bb.min.y,
|
|
70
|
+
bb.min.z
|
|
71
|
+
];
|
|
72
|
+
const max = [
|
|
73
|
+
bb.max.x,
|
|
74
|
+
bb.max.y,
|
|
75
|
+
bb.max.z
|
|
131
76
|
];
|
|
132
|
-
|
|
133
|
-
id:
|
|
134
|
-
mesh:
|
|
135
|
-
geometry:
|
|
136
|
-
material:
|
|
137
|
-
triangleIndices:
|
|
138
|
-
min
|
|
139
|
-
max
|
|
77
|
+
islands.push({
|
|
78
|
+
id: nextId++,
|
|
79
|
+
mesh: obj,
|
|
80
|
+
geometry: subGeo,
|
|
81
|
+
material: mat,
|
|
82
|
+
triangleIndices: triIndices,
|
|
83
|
+
min,
|
|
84
|
+
max,
|
|
140
85
|
size: [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
86
|
+
max[0] - min[0],
|
|
87
|
+
max[1] - min[1],
|
|
88
|
+
max[2] - min[2]
|
|
144
89
|
],
|
|
145
90
|
center: [
|
|
146
|
-
(
|
|
147
|
-
(
|
|
148
|
-
(
|
|
91
|
+
(min[0] + max[0]) * .5,
|
|
92
|
+
(min[1] + max[1]) * .5,
|
|
93
|
+
(min[2] + max[2]) * .5
|
|
149
94
|
]
|
|
150
95
|
});
|
|
151
96
|
}
|
|
152
|
-
}), u;
|
|
153
|
-
}
|
|
154
|
-
function u(e, t, n, i = []) {
|
|
155
|
-
e.updateMatrixWorld(!0);
|
|
156
|
-
let s = new r.Matrix4().copy(e.matrixWorld).invert(), l = new r.Matrix4(), u = new Map(t.map((e) => [e.id, e])), d = /* @__PURE__ */ new Map(), f = (e) => {
|
|
157
|
-
let t = d.get(e);
|
|
158
|
-
return t || (t = o(e.geometry, l.multiplyMatrices(s, e.matrixWorld)), d.set(e, t)), t;
|
|
159
|
-
}, p = /* @__PURE__ */ new Map(), m = [], h = [];
|
|
160
|
-
for (let e of n) {
|
|
161
|
-
let t = e.islandIds.map((e) => u.get(e)).filter((e) => !!e);
|
|
162
|
-
if (t.length === 0) continue;
|
|
163
|
-
let n = [
|
|
164
|
-
Infinity,
|
|
165
|
-
Infinity,
|
|
166
|
-
Infinity
|
|
167
|
-
], i = [
|
|
168
|
-
-Infinity,
|
|
169
|
-
-Infinity,
|
|
170
|
-
-Infinity
|
|
171
|
-
], o = /* @__PURE__ */ new Map();
|
|
172
|
-
for (let e of t) {
|
|
173
|
-
for (let t = 0; t < 3; t++) n[t] = Math.min(n[t], e.min[t]), i[t] = Math.max(i[t], e.max[t]);
|
|
174
|
-
let t = o.get(e.mesh);
|
|
175
|
-
t || (t = [], o.set(e.mesh, t));
|
|
176
|
-
let r = p.get(e.mesh);
|
|
177
|
-
r || (r = /* @__PURE__ */ new Set(), p.set(e.mesh, r));
|
|
178
|
-
for (let n = 0; n < e.triangleIndices.length; n++) {
|
|
179
|
-
let i = e.triangleIndices[n];
|
|
180
|
-
t.push(i), r.add(i);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
let s = [
|
|
184
|
-
(n[0] + i[0]) * .5,
|
|
185
|
-
(n[1] + i[1]) * .5,
|
|
186
|
-
(n[2] + i[2]) * .5
|
|
187
|
-
], l = new r.Group();
|
|
188
|
-
l.name = e.nodeName, l.position.set(s[0], s[1], s[2]);
|
|
189
|
-
let d = 0;
|
|
190
|
-
for (let [t, n] of o) {
|
|
191
|
-
let i = new r.Mesh(c(f(t), n, [
|
|
192
|
-
-s[0],
|
|
193
|
-
-s[1],
|
|
194
|
-
-s[2]
|
|
195
|
-
]), a(t));
|
|
196
|
-
i.name = `${e.nodeName}_mesh_${d++}`, l.add(i);
|
|
197
|
-
}
|
|
198
|
-
m.push({
|
|
199
|
-
nodeName: e.nodeName,
|
|
200
|
-
center: s,
|
|
201
|
-
group: l
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
for (let e of i) {
|
|
205
|
-
let t = e.islandIds.map((e) => u.get(e)).filter((e) => !!e);
|
|
206
|
-
if (t.length === 0) continue;
|
|
207
|
-
let n = [
|
|
208
|
-
Infinity,
|
|
209
|
-
Infinity,
|
|
210
|
-
Infinity
|
|
211
|
-
], i = [
|
|
212
|
-
-Infinity,
|
|
213
|
-
-Infinity,
|
|
214
|
-
-Infinity
|
|
215
|
-
], o = /* @__PURE__ */ new Map();
|
|
216
|
-
for (let e of t) {
|
|
217
|
-
for (let t = 0; t < 3; t++) n[t] = Math.min(n[t], e.min[t]), i[t] = Math.max(i[t], e.max[t]);
|
|
218
|
-
let t = o.get(e.mesh);
|
|
219
|
-
t || (t = [], o.set(e.mesh, t));
|
|
220
|
-
let r = p.get(e.mesh);
|
|
221
|
-
r || (r = /* @__PURE__ */ new Set(), p.set(e.mesh, r));
|
|
222
|
-
for (let n = 0; n < e.triangleIndices.length; n++) {
|
|
223
|
-
let i = e.triangleIndices[n];
|
|
224
|
-
t.push(i), r.add(i);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
let s = [
|
|
228
|
-
(n[0] + i[0]) * .5,
|
|
229
|
-
(n[1] + i[1]) * .5,
|
|
230
|
-
(n[2] + i[2]) * .5
|
|
231
|
-
], l = [
|
|
232
|
-
Math.max(.05, i[0] - n[0]),
|
|
233
|
-
Math.max(.05, i[1] - n[1]),
|
|
234
|
-
Math.max(.05, i[2] - n[2])
|
|
235
|
-
], [d, m, g] = e.anchor, _ = new r.Group();
|
|
236
|
-
_.name = e.nodeName, _.position.set(d, m, g);
|
|
237
|
-
let v = 0;
|
|
238
|
-
for (let [t, n] of o) {
|
|
239
|
-
let i = new r.Mesh(c(f(t), n, [
|
|
240
|
-
-d,
|
|
241
|
-
-m,
|
|
242
|
-
-g
|
|
243
|
-
]), a(t));
|
|
244
|
-
i.name = `${e.nodeName}_skin_${v++}`, _.add(i);
|
|
245
|
-
}
|
|
246
|
-
h.push({
|
|
247
|
-
nodeName: e.nodeName,
|
|
248
|
-
anchor: [
|
|
249
|
-
d,
|
|
250
|
-
m,
|
|
251
|
-
g
|
|
252
|
-
],
|
|
253
|
-
center: s,
|
|
254
|
-
size: l,
|
|
255
|
-
group: _
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
let g = new r.Group();
|
|
259
|
-
g.name = "ChassisVisuals";
|
|
260
|
-
let _ = 0;
|
|
261
|
-
e.traverse((e) => {
|
|
262
|
-
if (!(e instanceof r.Mesh) || !e.geometry) return;
|
|
263
|
-
let t = f(e), n = t.getAttribute("position"), i = t.getIndex(), o = Math.floor(i ? i.count / 3 : (n?.count ?? 0) / 3), s = p.get(e);
|
|
264
|
-
if (o === 0 || s && s.size >= o) return;
|
|
265
|
-
let l = [];
|
|
266
|
-
for (let e = 0; e < o; e++) s && s.has(e) || l.push(e);
|
|
267
|
-
if (l.length > 0) {
|
|
268
|
-
let n = new r.Mesh(c(t, l), a(e));
|
|
269
|
-
n.name = `Body_mesh_${_++}`, g.add(n);
|
|
270
|
-
}
|
|
271
97
|
});
|
|
272
|
-
|
|
273
|
-
return {
|
|
274
|
-
wheels: m,
|
|
275
|
-
panels: h,
|
|
276
|
-
chassisGroup: g,
|
|
277
|
-
fullBounds: {
|
|
278
|
-
min: [
|
|
279
|
-
v.min.x,
|
|
280
|
-
v.min.y,
|
|
281
|
-
v.min.z
|
|
282
|
-
],
|
|
283
|
-
max: [
|
|
284
|
-
v.max.x,
|
|
285
|
-
v.max.y,
|
|
286
|
-
v.max.z
|
|
287
|
-
],
|
|
288
|
-
center: [
|
|
289
|
-
b.x,
|
|
290
|
-
b.y,
|
|
291
|
-
b.z
|
|
292
|
-
],
|
|
293
|
-
size: [
|
|
294
|
-
y.x,
|
|
295
|
-
v.max.y - v.min.y,
|
|
296
|
-
y.z
|
|
297
|
-
]
|
|
298
|
-
}
|
|
299
|
-
};
|
|
98
|
+
return islands;
|
|
300
99
|
}
|
|
301
|
-
export {
|
|
100
|
+
export { extractMeshIslands, measureSelection, normalizeSceneToSi, separateVehicleMeshes, sliceMeshTriangles, suggestCarAxles, toggleIslandSelection };
|
|
101
|
+
|
|
102
|
+
//# sourceMappingURL=meshIslands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meshIslands.js","names":[],"sources":["../../src/importer/meshIslands.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport {\n bakeGeometryTransform,\n isMeshObject,\n normalizeSceneToSi,\n primaryMatOf,\n sliceMeshTriangles,\n type NormalizedSiScene,\n type OrientTurns,\n type QuarterTurn,\n type ScaleAxis,\n} from \"./sceneSiNormalize.js\";\nimport {\n separateVehicleMeshes,\n type SeparatedPanelMesh,\n type SeparatedVehicleMeshes,\n type SeparatedWheelMesh,\n} from \"./vehiclePartSplit.js\";\nimport {\n measureSelection,\n suggestCarAxles,\n toggleIslandSelection,\n type SelectionBounds,\n type WheelAxle,\n} from \"./wheelAxlePairing.js\";\n\nexport interface MeshIsland {\n id: number;\n mesh: THREE.Mesh;\n geometry: THREE.BufferGeometry;\n material: THREE.Material;\n triangleIndices: Uint32Array;\n min: [number, number, number];\n max: [number, number, number];\n center: [number, number, number];\n size: [number, number, number];\n}\n\nexport {\n measureSelection,\n normalizeSceneToSi,\n separateVehicleMeshes,\n sliceMeshTriangles,\n suggestCarAxles,\n toggleIslandSelection,\n type NormalizedSiScene,\n type OrientTurns,\n type QuarterTurn,\n type ScaleAxis,\n type SelectionBounds,\n type SeparatedPanelMesh,\n type SeparatedVehicleMeshes,\n type SeparatedWheelMesh,\n type WheelAxle,\n};\n\nclass UnionFind {\n private readonly p: Int32Array;\n constructor(n: number) {\n this.p = new Int32Array(n);\n for (let i = 0; i < n; i++) this.p[i] = i;\n }\n find(x: number): number {\n let root = x;\n while (this.p[root] !== root) root = this.p[root];\n for (let cur = x; cur !== root; ) { const next = this.p[cur]; this.p[cur] = root; cur = next; }\n return root;\n }\n union(a: number, b: number): void {\n const ra = this.find(a), rb = this.find(b);\n if (ra !== rb) this.p[rb] = ra;\n }\n}\n\nexport function extractMeshIslands(normalizedScene: THREE.Object3D, weldTolerance = 1e-4): MeshIsland[] {\n const invTol = 1 / Math.max(1e-7, weldTolerance);\n normalizedScene.updateMatrixWorld(true);\n const invRoot = new THREE.Matrix4().copy(normalizedScene.matrixWorld).invert();\n const relMat = new THREE.Matrix4();\n const islands: MeshIsland[] = [];\n let nextId = 0;\n\n normalizedScene.traverse((obj) => {\n if (!isMeshObject(obj)) return;\n const pos = obj.geometry.getAttribute(\"position\");\n if (!pos || pos.count < 3) return;\n\n const baked = bakeGeometryTransform(obj.geometry, relMat.multiplyMatrices(invRoot, obj.matrixWorld));\n const bPos = baked.getAttribute(\"position\");\n const index = baked.getIndex();\n const triCount = Math.floor((index ? index.count : bPos.count) / 3);\n if (triCount === 0) return;\n\n const uf = new UnionFind(triCount);\n const vertToTri = new Map<string, number>();\n for (let t = 0; t < triCount; t++) {\n for (let c = 0; c < 3; c++) {\n const vi = index ? index.getX(t * 3 + c) : t * 3 + c;\n const vKey = `${Math.round(bPos.getX(vi) * invTol)},${Math.round(bPos.getY(vi) * invTol)},${Math.round(bPos.getZ(vi) * invTol)}`;\n const prevTri = vertToTri.get(vKey);\n if (prevTri === undefined) vertToTri.set(vKey, t);\n else uf.union(t, prevTri);\n }\n }\n\n const groups = new Map<number, number[]>();\n for (let t = 0; t < triCount; t++) {\n const root = uf.find(t);\n let list = groups.get(root);\n if (!list) { list = []; groups.set(root, list); }\n list.push(t);\n }\n\n const mat = primaryMatOf(obj);\n for (const triList of groups.values()) {\n const triIndices = new Uint32Array(triList);\n const subGeo = sliceMeshTriangles(baked, triIndices);\n const bb = subGeo.boundingBox!;\n const min: [number, number, number] = [bb.min.x, bb.min.y, bb.min.z];\n const max: [number, number, number] = [bb.max.x, bb.max.y, bb.max.z];\n islands.push({\n id: nextId++, mesh: obj, geometry: subGeo, material: mat, triangleIndices: triIndices,\n min, max,\n size: [max[0] - min[0], max[1] - min[1], max[2] - min[2]],\n center: [(min[0] + max[0]) * 0.5, (min[1] + max[1]) * 0.5, (min[2] + max[2]) * 0.5],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AK,iBAAiB;IAC3E;IAAK;IACL,MAAM;KAAC,IAAI,KAAK,IAAI;KAAI,IAAI,KAAK,IAAI;KAAI,IAAI,KAAK,IAAI;IAAE;IACxD,QAAQ;MAAE,IAAI,KAAK,IAAI,MAAM;MAAM,IAAI,KAAK,IAAI,MAAM;MAAM,IAAI,KAAK,IAAI,MAAM;IAAG;GACtF,CAAC;EACL;CACJ,CAAC;CAED,OAAO;AACX"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { type SliceTri } from "./cylinderSliceMath.js";
|
|
3
|
+
export interface MaterialBucket {
|
|
4
|
+
material: THREE.Material;
|
|
5
|
+
tris: SliceTri[];
|
|
6
|
+
extras: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
itemSize: number;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare function collectMeshBuckets(root: THREE.Object3D): MaterialBucket[];
|
|
12
|
+
export declare function buildGeometryFromTris(tris: readonly SliceTri[], extras: ReadonlyArray<{
|
|
13
|
+
name: string;
|
|
14
|
+
itemSize: number;
|
|
15
|
+
}>, offset?: readonly [number, number, number]): THREE.BufferGeometry;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { triArea2 } from "./cylinderSliceMath.js";
|
|
2
|
+
import { isMeshObject } from "./sceneSiNormalize.js";
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
// src/importer/meshSliceBuffers.ts
|
|
5
|
+
function flipGeoWinding(geo) {
|
|
6
|
+
const idx = geo.getIndex();
|
|
7
|
+
if (idx) {
|
|
8
|
+
for (let i = 0; i + 2 < idx.count; i += 3) {
|
|
9
|
+
const tmp = idx.getX(i + 1);
|
|
10
|
+
idx.setX(i + 1, idx.getX(i + 2));
|
|
11
|
+
idx.setX(i + 2, tmp);
|
|
12
|
+
}
|
|
13
|
+
idx.needsUpdate = true;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const count = geo.getAttribute("position")?.count ?? 0;
|
|
17
|
+
const arr = new Uint32Array(count);
|
|
18
|
+
for (let i = 0; i + 2 < count; i += 3) {
|
|
19
|
+
arr[i] = i;
|
|
20
|
+
arr[i + 1] = i + 2;
|
|
21
|
+
arr[i + 2] = i + 1;
|
|
22
|
+
}
|
|
23
|
+
geo.setIndex(new THREE.BufferAttribute(arr, 1));
|
|
24
|
+
}
|
|
25
|
+
function collectMeshBuckets(root) {
|
|
26
|
+
root.updateMatrixWorld(true);
|
|
27
|
+
const invRoot = new THREE.Matrix4().copy(root.matrixWorld).invert();
|
|
28
|
+
const relMat = new THREE.Matrix4();
|
|
29
|
+
const buckets = [];
|
|
30
|
+
root.traverse((obj) => {
|
|
31
|
+
if (!isMeshObject(obj)) return;
|
|
32
|
+
const rawPos = obj.geometry.getAttribute("position");
|
|
33
|
+
if (!rawPos || rawPos.count < 3) return;
|
|
34
|
+
relMat.multiplyMatrices(invRoot, obj.matrixWorld);
|
|
35
|
+
const geo = obj.geometry.clone();
|
|
36
|
+
const flip = relMat.determinant() < 0;
|
|
37
|
+
geo.applyMatrix4(relMat);
|
|
38
|
+
if (flip) flipGeoWinding(geo);
|
|
39
|
+
if (!geo.getAttribute("normal")) geo.computeVertexNormals();
|
|
40
|
+
geo.computeBoundingBox();
|
|
41
|
+
const pos = geo.getAttribute("position"), nrm = geo.getAttribute("normal"), uv = geo.getAttribute("uv");
|
|
42
|
+
const bb = geo.boundingBox;
|
|
43
|
+
const spanX = Math.max(1e-4, bb.max.x - bb.min.x), spanZ = Math.max(1e-4, bb.max.z - bb.min.z);
|
|
44
|
+
const extraMetas = [];
|
|
45
|
+
let extraLen = 0;
|
|
46
|
+
for (const name of Object.keys(geo.attributes)) {
|
|
47
|
+
if (name === "position" || name === "normal" || name === "uv") continue;
|
|
48
|
+
const attr = geo.getAttribute(name);
|
|
49
|
+
if (attr && attr.itemSize >= 1 && attr.itemSize <= 4) {
|
|
50
|
+
extraMetas.push({
|
|
51
|
+
name,
|
|
52
|
+
itemSize: attr.itemSize,
|
|
53
|
+
attr
|
|
54
|
+
});
|
|
55
|
+
extraLen += attr.itemSize;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const stride = 8 + extraLen;
|
|
59
|
+
const readVert = (vi) => {
|
|
60
|
+
const v = new Float64Array(stride);
|
|
61
|
+
const px = pos.getX(vi), py = pos.getY(vi), pz = pos.getZ(vi);
|
|
62
|
+
v[0] = Number.isFinite(px) ? px : 0;
|
|
63
|
+
v[1] = Number.isFinite(py) ? py : 0;
|
|
64
|
+
v[2] = Number.isFinite(pz) ? pz : 0;
|
|
65
|
+
const nx = nrm?.getX(vi) ?? 0, ny = nrm?.getY(vi) ?? 1, nz = nrm?.getZ(vi) ?? 0;
|
|
66
|
+
const nl = Math.hypot(nx, ny, nz);
|
|
67
|
+
if (Number.isFinite(nl) && nl > 1e-8) {
|
|
68
|
+
v[3] = nx / nl;
|
|
69
|
+
v[4] = ny / nl;
|
|
70
|
+
v[5] = nz / nl;
|
|
71
|
+
} else {
|
|
72
|
+
v[3] = 0;
|
|
73
|
+
v[4] = 1;
|
|
74
|
+
v[5] = 0;
|
|
75
|
+
}
|
|
76
|
+
const u0 = uv?.getX(vi), v0 = uv?.getY(vi);
|
|
77
|
+
v[6] = u0 !== void 0 && Number.isFinite(u0) ? u0 : (v[0] - bb.min.x) / spanX;
|
|
78
|
+
v[7] = v0 !== void 0 && Number.isFinite(v0) ? v0 : (v[2] - bb.min.z) / spanZ;
|
|
79
|
+
let off = 8;
|
|
80
|
+
for (const em of extraMetas) for (let k = 0; k < em.itemSize; k++) {
|
|
81
|
+
const val = em.attr.getComponent(vi, k);
|
|
82
|
+
v[off++] = Number.isFinite(val) ? val : 0;
|
|
83
|
+
}
|
|
84
|
+
return v;
|
|
85
|
+
};
|
|
86
|
+
const idx = geo.getIndex();
|
|
87
|
+
const totalTris = Math.floor((idx ? idx.count : pos.count) / 3);
|
|
88
|
+
const mats = Array.isArray(obj.material) ? obj.material : [obj.material ?? new THREE.MeshStandardMaterial({ color: "#cbd5e1" })];
|
|
89
|
+
const groups = geo.groups.length > 0 && Array.isArray(obj.material) ? geo.groups : [{
|
|
90
|
+
start: 0,
|
|
91
|
+
count: totalTris * 3,
|
|
92
|
+
materialIndex: 0
|
|
93
|
+
}];
|
|
94
|
+
for (const grp of groups) {
|
|
95
|
+
const mat = mats[grp.materialIndex ?? 0] ?? mats[0];
|
|
96
|
+
const startTri = Math.floor(grp.start / 3);
|
|
97
|
+
const endTri = Math.min(totalTris, startTri + Math.floor(grp.count / 3));
|
|
98
|
+
const tris = [];
|
|
99
|
+
for (let t = startTri; t < endTri; t++) {
|
|
100
|
+
const a = readVert(idx ? idx.getX(t * 3) : t * 3);
|
|
101
|
+
const b = readVert(idx ? idx.getX(t * 3 + 1) : t * 3 + 1);
|
|
102
|
+
const c = readVert(idx ? idx.getX(t * 3 + 2) : t * 3 + 2);
|
|
103
|
+
if (triArea2(a, b, c) > 1e-14) tris.push([
|
|
104
|
+
a,
|
|
105
|
+
b,
|
|
106
|
+
c
|
|
107
|
+
]);
|
|
108
|
+
}
|
|
109
|
+
if (tris.length > 0) buckets.push({
|
|
110
|
+
material: mat,
|
|
111
|
+
tris,
|
|
112
|
+
extras: extraMetas.map((e) => ({
|
|
113
|
+
name: e.name,
|
|
114
|
+
itemSize: e.itemSize
|
|
115
|
+
}))
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
geo.dispose();
|
|
119
|
+
});
|
|
120
|
+
return buckets;
|
|
121
|
+
}
|
|
122
|
+
function buildGeometryFromTris(tris, extras, offset = [
|
|
123
|
+
0,
|
|
124
|
+
0,
|
|
125
|
+
0
|
|
126
|
+
]) {
|
|
127
|
+
const n = tris.length * 3;
|
|
128
|
+
const pos = new Float32Array(n * 3), nrm = new Float32Array(n * 3), uv = new Float32Array(n * 2);
|
|
129
|
+
const exArrs = extras.map((e) => ({
|
|
130
|
+
...e,
|
|
131
|
+
data: new Float32Array(n * e.itemSize)
|
|
132
|
+
}));
|
|
133
|
+
let vi = 0;
|
|
134
|
+
for (const tri of tris) for (let c = 0; c < 3; c++) {
|
|
135
|
+
const v = tri[c];
|
|
136
|
+
pos[vi * 3] = v[0] + offset[0];
|
|
137
|
+
pos[vi * 3 + 1] = v[1] + offset[1];
|
|
138
|
+
pos[vi * 3 + 2] = v[2] + offset[2];
|
|
139
|
+
nrm[vi * 3] = v[3];
|
|
140
|
+
nrm[vi * 3 + 1] = v[4];
|
|
141
|
+
nrm[vi * 3 + 2] = v[5];
|
|
142
|
+
uv[vi * 2] = v[6];
|
|
143
|
+
uv[vi * 2 + 1] = v[7];
|
|
144
|
+
let off = 8;
|
|
145
|
+
for (const ex of exArrs) for (let k = 0; k < ex.itemSize; k++) ex.data[vi * ex.itemSize + k] = v[off++];
|
|
146
|
+
vi++;
|
|
147
|
+
}
|
|
148
|
+
const geo = new THREE.BufferGeometry();
|
|
149
|
+
geo.setAttribute("position", new THREE.BufferAttribute(pos, 3));
|
|
150
|
+
geo.setAttribute("normal", new THREE.BufferAttribute(nrm, 3));
|
|
151
|
+
geo.setAttribute("uv", new THREE.BufferAttribute(uv, 2));
|
|
152
|
+
for (const ex of exArrs) geo.setAttribute(ex.name, new THREE.BufferAttribute(ex.data, ex.itemSize));
|
|
153
|
+
geo.computeBoundingBox();
|
|
154
|
+
geo.computeBoundingSphere();
|
|
155
|
+
return geo;
|
|
156
|
+
}
|
|
157
|
+
export { buildGeometryFromTris, collectMeshBuckets };
|
|
158
|
+
|
|
159
|
+
//# sourceMappingURL=meshSliceBuffers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meshSliceBuffers.js","names":[],"sources":["../../src/importer/meshSliceBuffers.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport { triArea2, type SliceTri, type SliceVert } from \"./cylinderSliceMath.js\";\nimport { isMeshObject } from \"./sceneSiNormalize.js\";\n\nexport interface MaterialBucket {\n material: THREE.Material;\n tris: SliceTri[];\n extras: Array<{ name: string; itemSize: number }>;\n}\n\nfunction flipGeoWinding(geo: THREE.BufferGeometry): void {\n const idx = geo.getIndex();\n if (idx) {\n for (let i = 0; i + 2 < idx.count; i += 3) {\n const tmp = idx.getX(i + 1);\n idx.setX(i + 1, idx.getX(i + 2));\n idx.setX(i + 2, tmp);\n }\n idx.needsUpdate = true;\n return;\n }\n const count = geo.getAttribute(\"position\")?.count ?? 0;\n const arr = new Uint32Array(count);\n for (let i = 0; i + 2 < count; i += 3) {\n arr[i] = i;\n arr[i + 1] = i + 2;\n arr[i + 2] = i + 1;\n }\n geo.setIndex(new THREE.BufferAttribute(arr, 1));\n}\n\nexport function collectMeshBuckets(root: THREE.Object3D): MaterialBucket[] {\n root.updateMatrixWorld(true);\n const invRoot = new THREE.Matrix4().copy(root.matrixWorld).invert();\n const relMat = new THREE.Matrix4();\n const buckets: MaterialBucket[] = [];\n\n root.traverse((obj) => {\n if (!isMeshObject(obj)) return;\n const rawPos = obj.geometry.getAttribute(\"position\");\n if (!rawPos || rawPos.count < 3) return;\n relMat.multiplyMatrices(invRoot, obj.matrixWorld);\n const geo = obj.geometry.clone();\n const flip = relMat.determinant() < 0;\n geo.applyMatrix4(relMat);\n if (flip) flipGeoWinding(geo);\n if (!geo.getAttribute(\"normal\")) geo.computeVertexNormals();\n geo.computeBoundingBox();\n\n const pos = geo.getAttribute(\"position\"), nrm = geo.getAttribute(\"normal\"), uv = geo.getAttribute(\"uv\");\n const bb = geo.boundingBox!;\n const spanX = Math.max(1e-4, bb.max.x - bb.min.x), spanZ = Math.max(1e-4, bb.max.z - bb.min.z);\n const extraMetas: Array<{ name: string; itemSize: number; attr: THREE.BufferAttribute | THREE.InterleavedBufferAttribute }> = [];\n let extraLen = 0;\n for (const name of Object.keys(geo.attributes)) {\n if (name === \"position\" || name === \"normal\" || name === \"uv\") continue;\n const attr = geo.getAttribute(name);\n if (attr && attr.itemSize >= 1 && attr.itemSize <= 4) {\n extraMetas.push({ name, itemSize: attr.itemSize, attr });\n extraLen += attr.itemSize;\n }\n }\n const stride = 8 + extraLen;\n const readVert = (vi: number): SliceVert => {\n const v = new Float64Array(stride);\n const px = pos.getX(vi), py = pos.getY(vi), pz = pos.getZ(vi);\n v[0] = Number.isFinite(px) ? px : 0;\n v[1] = Number.isFinite(py) ? py : 0;\n v[2] = Number.isFinite(pz) ? pz : 0;\n const nx = nrm?.getX(vi) ?? 0, ny = nrm?.getY(vi) ?? 1, nz = nrm?.getZ(vi) ?? 0;\n const nl = Math.hypot(nx, ny, nz);\n if (Number.isFinite(nl) && nl > 1e-8) { v[3] = nx / nl; v[4] = ny / nl; v[5] = nz / nl; }\n else { v[3] = 0; v[4] = 1; v[5] = 0; }\n const u0 = uv?.getX(vi), v0 = uv?.getY(vi);\n v[6] = u0 !== undefined && Number.isFinite(u0) ? u0 : (v[0] - bb.min.x) / spanX;\n v[7] = v0 !== undefined && Number.isFinite(v0) ? v0 : (v[2] - bb.min.z) / spanZ;\n let off = 8;\n for (const em of extraMetas) {\n for (let k = 0; k < em.itemSize; k++) {\n const val = em.attr.getComponent(vi, k);\n v[off++] = Number.isFinite(val) ? val : 0;\n }\n }\n return v;\n };\n\n const idx = geo.getIndex();\n const totalTris = Math.floor((idx ? idx.count : pos.count) / 3);\n const mats = Array.isArray(obj.material)\n ? obj.material\n : [obj.material ?? new THREE.MeshStandardMaterial({ color: \"#cbd5e1\" })];\n const groups = geo.groups.length > 0 && Array.isArray(obj.material)\n ? geo.groups\n : [{ start: 0, count: totalTris * 3, materialIndex: 0 }];\n\n for (const grp of groups) {\n const mat = mats[grp.materialIndex ?? 0] ?? mats[0];\n const startTri = Math.floor(grp.start / 3);\n const endTri = Math.min(totalTris, startTri + Math.floor(grp.count / 3));\n const tris: SliceTri[] = [];\n for (let t = startTri; t < endTri; t++) {\n const a = readVert(idx ? idx.getX(t * 3) : t * 3);\n const b = readVert(idx ? idx.getX(t * 3 + 1) : t * 3 + 1);\n const c = readVert(idx ? idx.getX(t * 3 + 2) : t * 3 + 2);\n if (triArea2(a, b, c) > 1e-14) tris.push([a, b, c]);\n }\n if (tris.length > 0)\n buckets.push({ material: mat, tris, extras: extraMetas.map((e) => ({ name: e.name, itemSize: e.itemSize })) });\n }\n geo.dispose();\n });\n\n return buckets;\n}\n\nexport function buildGeometryFromTris(\n tris: readonly SliceTri[],\n extras: ReadonlyArray<{ name: string; itemSize: number }>,\n offset: readonly [number, number, number] = [0, 0, 0],\n): THREE.BufferGeometry {\n const n = tris.length * 3;\n const pos = new Float32Array(n * 3), nrm = new Float32Array(n * 3), uv = new Float32Array(n * 2);\n const exArrs = extras.map((e) => ({ ...e, data: new Float32Array(n * e.itemSize) }));\n let vi = 0;\n for (const tri of tris) {\n for (let c = 0; c < 3; c++) {\n const v = tri[c];\n pos[vi * 3] = v[0] + offset[0]; pos[vi * 3 + 1] = v[1] + offset[1]; pos[vi * 3 + 2] = v[2] + offset[2];\n nrm[vi * 3] = v[3]; nrm[vi * 3 + 1] = v[4]; nrm[vi * 3 + 2] = v[5];\n uv[vi * 2] = v[6]; uv[vi * 2 + 1] = v[7];\n let off = 8;\n for (const ex of exArrs) {\n for (let k = 0; k < ex.itemSize; k++) ex.data[vi * ex.itemSize + k] = v[off++];\n }\n vi++;\n }\n }\n const geo = new THREE.BufferGeometry();\n geo.setAttribute(\"position\", new THREE.BufferAttribute(pos, 3));\n geo.setAttribute(\"normal\", new THREE.BufferAttribute(nrm, 3));\n geo.setAttribute(\"uv\", new THREE.BufferAttribute(uv, 2));\n for (const ex of exArrs) geo.setAttribute(ex.name, new THREE.BufferAttribute(ex.data, ex.itemSize));\n geo.computeBoundingBox();\n geo.computeBoundingSphere();\n return geo;\n}\n"],"mappings":";;;;AAUA,SAAS,eAAe,KAAiC;CACrD,MAAM,MAAM,IAAI,SAAS;CACzB,IAAI,KAAK;EACL,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,OAAO,KAAK,GAAG;GACvC,MAAM,MAAM,IAAI,KAAK,IAAI,CAAC;GAC1B,IAA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