Rhino Compute - CreateFromBrep-> Meshing Parameters

Hey guys. I noticed from the https://mcneel.github.io/rhino3dm/javascript/samples/resources/compute.rhino3d.js page that there is an overloaded function where you can pass in the meshing parameters when you’re trying to create a mesh from a brep. The method signature is createFromBrep1 : function(brep, meshingParameters, multiple=false). However, I can’t find any documentation on how to define those meshing parameters. Can you provide any guidance as to what you’re actually supposed to pass into that function?

Hey Andy, here’s a quick example…

// assume we're inside an async function
const sphere = new Rhino3dm.Sphere([0, 0, 0], 12)
console.log(sphere.diameter)
const brep = sphere.toBrep()
const mp = new Rhino3dm.MeshingParameters(0.5)
const res = await compute.Mesh.createFromBrep1(brep, mp)
const meshes = res.map(r => Rhino3dm.CommonObject.decode(r))
console.log(meshes[0].vertices().count)

The rhino3dm.js API documentation describes the MeshingParameters class further.

Thanks Will! I didn’t realize that rhino3dm.js had its own API docs so that will be very helpful.

1 Like

The various API docs are all linked from https://developer.rhino3d.com/api/, to save you searching around!