Socket
Socket
Sign inDemoInstall

@smrq/openscad-js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smrq/openscad-js

OpenSCAD, but in a real programming language


Version published
Maintainers
1
Install size
Created

Readme

Source

openscad-js

OpenSCAD, but in a real language :)

Usage

const { compile, modules: m } = require('@smrq/openscad-js');

const model = m.translate([10, 20, 30])(
    m.cube([1, 2, 3], { center: true })
);

console.log(compile(model));

What features in OpenSCAD does this support?

Literally anything that follows the OpenSCAD module syntax. Nothing is built into this library, it just rewrites things into the OpenSCAD syntax.

m.foo(1, 2, { bar: 3, baz: 4 })(
    m.quux([5, 6, 7])
)

=>

foo(1, 2, bar=3, baz=4) {
    quux([5, 6, 7]);
}

I don't want to prefix everything with m.

That's too bad for you.

Isn't there another way?

Okay, but don't say I didn't warn you.

const { compile, globals } = require('@smrq/openscad');
with (globals(x => eval(x))) {

  const model = translate([10, 20, 30])(
    cube([1, 2, 3], { center: true })
  );

  console.log(compile(model));

}

FAQs

Package last updated on 31 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc