In the end, I imported @jscad and used Path2 and Expand to build my profile for extruding and then handed those points over to Babylon to do the extrusion to mesh. Works well.
Latest posts made by ajw1970
-
RE: Using JSCAD to build meshes for BabylonJS
-
RE: Using JSCAD to build meshes for BabylonJS
@hrgdavor Thank you. I think for now I can just use JSCAD to get the points for my profile. I can then extrude that in BabylonJs to get the meshes.
-
RE: Using JSCAD to build meshes for BabylonJS
@hrgdavor I'm working with a consultant with experience in BabylonJs. The end goal will be a full coil processing line simulator and everything I'm seeing about BabylonJs looks to be right for the job with the exception of dynamically modeling this part.
-
Using JSCAD to build meshes for BabylonJS
Does anybody have experience with using JSCAD to build meshes for use in BabylonJS?
I'm looking to build some dynamic models which are going beyond the capabilities of BabylonJS but I would like to use them within BabylonJS.
I'm looking for any advice I can find. Thank you.
For context, I started out in Babylon and ran into limitations with their path2d fuctions:
https://forum.babylonjs.com/t/trying-to-build-an-extruded-path2-with-ribbon/27808/3
I then tried it in JSCAD:
/** * 2D Primitives Demonstration * @category Creating Shapes * @skillLevel 1 * @description Demonstrating the basics of a variety of 2D primitives * @tags circle, square, line, ellipse, polygon, shape, 2d * @authors Simon Clark * @licence MIT License */ const { path2 } = require('@jscad/modeling').geometries const { expand, offset } = require('@jscad/modeling').expansions const { extrudeLinear, extrudeRectangular, extrudeRotate } = require('@jscad/modeling').extrusions const { translate } = require('@jscad/modeling').transforms const main = () => { let tdcPathCenter = path2.fromPoints({}, [[0,0]]); tdcPathCenter = path2.appendArc({endpoint: [-0.0596,-0.02], radius: [0.0988,0.0988]}, tdcPathCenter); tdcPathCenter = path2.appendPoints([[-0.0922,-0.0447]],tdcPathCenter); tdcPathCenter = path2.appendArc({endpoint: [-0.123,-0.055], radius: [0.051,0.051], clockwise: true}, tdcPathCenter); tdcPathCenter = path2.appendPoints([[-0.2432,-0.055]],tdcPathCenter); tdcPathCenter = path2.appendArc({endpoint: [-0.2942,-0.004], radius: [0.051,0.051], clockwise: true}, tdcPathCenter); tdcPathCenter = path2.appendPoints([[-0.2942,1.1196]],tdcPathCenter); tdcPathCenter = path2.appendArc({endpoint: [-0.2479,1.1704], radius: [0.051,0.051], clockwise: true}, tdcPathCenter); tdcPathCenter = path2.appendPoints([[-0.1272,1.1803]],tdcPathCenter); tdcPathCenter = path2.appendArc({endpoint: [-0.1002,1.1677], radius: [0.03,0.03], clockwise: true}, tdcPathCenter); tdcPathCenter = path2.appendArc({endpoint: [-0.0467,1.2829], radius: [0.0733,0.0733], clockwise: false, large: true}, tdcPathCenter); tdcPathCenter = path2.appendPoints([[-0.2466,1.2664]],tdcPathCenter); let tdcProfile = expand({delta:0.015}, tdcPathCenter); let tdcFlange = extrudeLinear({height: 10}, tdcProfile); return tdcFlange; } module.exports = { main }
I'm wondering how to then extract from this solid something that could be used in BabylonJS