Published
Edited
Jun 17, 2019
2 forks
5 stars
Insert cell
Insert cell
Insert cell
rhino3dm_module = require('rhino3dm@0.1.9')
Insert cell
Insert cell
mutable rhino3dm = null
Insert cell
Insert cell
{
rhino3dm_module().then ((m) => {
// this is janky but it's best we've got, currently
mutable rhino3dm = {
Sphere: m.Sphere,
Arc: m.Arc,
Point3dList: m.Point3dList,
NurbsCurve: m.NurbsCurve
}
// this doesn't work
//mutable rhino3dm = m
})
return rhino3dm === null ? false : true
}
Insert cell
Insert cell
s = new rhino3dm.Sphere([0,0,0], 15)
Insert cell
s.diameter
Insert cell
Insert cell
a = new rhino3dm.Arc([150,50,0], 100, 0.8 * Math.PI)
Insert cell
Insert cell
c.points().get(0)
Insert cell
Insert cell
Insert cell
Insert cell
curve = {
const points = new rhino3dm.Point3dList();
points.add(20,50,0);
points.add(100,180,0);
points.add(200,20,0);
points.add(250,150,0);
points.add(350,140,0);
points.add(400,100,0);
points.add(480,30,0);
points.add(520,170,0);
points.add(570,170,0);
const curve = rhino3dm.NurbsCurve.create(false, 3, points);
return curve;
}

Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more