Script: Exmaple in TypeScript

Exmaple in TypeScript picture
Type
Typescript logo indicatortypescript
Date Created
Mar 19, 2021, 8:51:02 AM
Last Edit Date
Dec 5, 2023, 7:13:16 PM

Project Information

This simple example creates a list of three points, assigns the list to variable and creates polyline from that.

View Full Project

Script Code


const Inputs = Bit.Inputs;

const whiteColour = '#ffffff';
const blackColour = '#000000';
const lightGreyColour = '#eeeeee';
const yellowColour = '#ffcc66';

bitbybit.babylon.scene.backgroundColour({ colour: blackColour });

const drawGridMeshInput = new Inputs.Draw.SceneDrawGridMeshDto();
drawGridMeshInput.mainColor = whiteColour;
drawGridMeshInput.secondaryColor = lightGreyColour;
bitbybit.draw.drawGridMesh(drawGridMeshInput);

const pointsForPolyline = [[0, 0, 0], [2, 4, 0], [3, 0, 0]] as Bit.Inputs.Base.Point3[];

const drawPointsInput = new Inputs.Draw.DrawBasicGeometryOptions();
drawPointsInput.size = 0.2;
drawPointsInput.colours = whiteColour;
bitbybit.draw.drawAny({ entity: pointsForPolyline, options: drawPointsInput });

const polyline = bitbybit.polyline.create({ points: pointsForPolyline });
const drawPolylineInput = new Inputs.Draw.DrawBasicGeometryOptions();
drawPolylineInput.colours = yellowColour;
drawPolylineInput.size = 8;
bitbybit.draw.drawAny({ entity: polyline, options: drawPolylineInput });
Plans & Pricing

Choose Your Plan

Editor plans for 3D development, API keys for server-side CAD algorithms

B2B

ENTERPRISE

Custom pricing

Custom software development, dedicated servers & CAD automation at scale.

CAD Automation & Software
  • Custom software development
  • Cloud CAD automation pipelines
  • 3D configurators (STEP & GLTF)
  • Batch export jobs
  • Custom algorithms & deployment
Infrastructure & Support
  • Custom compute allocation
  • Dedicated / VPS server tenants
  • Long-running computation jobs
  • Custom upload limits & overage
  • SLA & premium support