How to use the @jscad/modeling.extrudeFromSlices function in @jscad/modeling

To help you get started, we’ve selected a few @jscad/modeling examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jscad / OpenJSCAD.org / packages / examples / core / extrusions / extrudeFromSlices.js View on Github external
let withHoles = geom2.create(
    [
      [[-10.0, 10.0], [-10.0, -10.0]],
      [[-10.0, -10.0], [10.0, -10.0]],
      [[10.0, -10.0], [10.0, 10.0]],
      [[10.0, 10.0], [-10.0, 10.0]],
      [[-5.0, -5.0], [-5.0, 5.0]],
      [[5.0, -5.0], [-5.0, -5.0]],
      [[5.0, 5.0], [5.0, -5.0]],
      [[-5.0, 5.0], [5.0, 5.0]]
    ]
  )

  return [

    extrudeFromSlices({ }, withHoles)
  ]
}
github jscad / OpenJSCAD.org / packages / examples / core / extrusions / extrudeFromSlices.js View on Github external
const main = () => {
  const base = circle({ radius: 4, segments: 4 })
  let geometry3 = extrudeFromSlices(
    {
      numberOfSlices: 5,
      callback: (progress, count, base) => {
        let newshape = circle({ radius: 5 + count, segments: 4 + count })
        let newslice = slice.fromSides(geom2.toSides(newshape))
        newslice = slice.transform(mat4.fromTranslation([0, 0, count * 10]), newslice)
        return newslice
      }
    }, base
  )

  let withHoles = geom2.create(
    [
      [[-10.0, 10.0], [-10.0, -10.0]],
      [[-10.0, -10.0], [10.0, -10.0]],
      [[10.0, -10.0], [10.0, 10.0]],