Example in TypeScript

Example in TypeScript script details
Type
Typescript logo image
typescript
App Version
0.13.0
Visibility
public
Date Created
Mar 19, 2021, 8:18:09 AM
Last Edit Date
Dec 5, 2023, 6:15:01 PM

Script Details

The Code
const Inputs = Bit.Inputs; const whiteColour = '#ffffff'; const lightGreyColour = '#eeeeee'; const greyColour = '#666666'; const drawGridMeshInput = new Inputs.Draw.SceneDrawGridMeshDto(); drawGridMeshInput.mainColor = whiteColour; drawGridMeshInput.secondaryColor = lightGreyColour; bitbybit.draw.drawGridMesh(drawGridMeshInput); const pointsForCurve = [[0, 0, 0], [1, 2, -2], [-2, 3, -1], [0, 4, 2], [2, 2, 0], [2, 3, 0], [0, 0, 1]] as Bit.Inputs.Base.Point3[]; const curve = bitbybit.verb.curve.createCurveByPoints({ points: pointsForCurve, degree: 3 }); const drawCurveInput = new Inputs.Draw.DrawBasicGeometryOptions(); drawCurveInput.size = 5; drawCurveInput.colours = greyColour; bitbybit.draw.drawAny({ entity: curve, options: drawCurveInput }); const subdividedPoints = bitbybit.verb.curve.divideByEqualArcLengthToPoints({ curve, subdivision: 20, }); const drawPointsInput = new Inputs.Draw.DrawBasicGeometryOptions(); drawPointsInput.size = 0.2; drawPointsInput.colours = whiteColour; bitbybit.draw.drawAny({ entity: subdividedPoints, options: drawPointsInput });