meta data for this page
  •  

General Functions

Colors

The 'colors' are accessed through the modeling API using the following:

const { colorize, hexToRgb } = require('@jscad/modeling').colors
Function Notes
let newshape = colorize([1, 0, 0], oldshape) API
let newshape = colorize(colorNameToRgb('lightblue'), oldshape) API
let newshape = colorize(hexToRgb('#000080'), oldshape) API
let newshape = colorize(hslToRgb([0.9166666666666666, 1, 0.5]), oldshape) API
let newshape = colorize(hsvToRgb([0.9166666666666666, 1, 1]), oldshape) API

Utilities

The 'utils' are accessed through the modeling API using the following:

const { radToDeg, degToRad } = require('@jscad/modeling').utils
Function Notes
let radians = degToRad(90) API
let degrees = radToDeg(Math.PI) API
let segments = radiusToSegments(3.5, 0.1, 0) /* min length */ API
let segments = radiusToSegments(3.5, 0, Math.PI * 2 / 300) /* min angle */ API