@bitbybit-dev/jscad
Version:
Bit By Bit Developers JSCAD based CAD Library to Program Geometry
1,734 lines (1,733 loc) • 62.5 kB
JavaScript
// tslint:disable-next-line: no-namespace
export var JSCAD;
(function (JSCAD) {
class PolylinePropertiesDto {
/**
* Provide options without default values
*/
constructor(points, isClosed) {
/**
* Can contain is closed information
*/
this.isClosed = false;
if (points !== undefined) {
this.points = points;
}
if (isClosed !== undefined) {
this.isClosed = isClosed;
}
}
}
JSCAD.PolylinePropertiesDto = PolylinePropertiesDto;
let solidCornerTypeEnum;
(function (solidCornerTypeEnum) {
/**
* Edges will meet at a corner
*/
solidCornerTypeEnum["edge"] = "edge";
/**
* Edges will be rounded on the corner
*/
solidCornerTypeEnum["round"] = "round";
/**
* Edges will be chamfered on the corner
*/
solidCornerTypeEnum["chamfer"] = "chamfer";
})(solidCornerTypeEnum = JSCAD.solidCornerTypeEnum || (JSCAD.solidCornerTypeEnum = {}));
let jscadTextAlignEnum;
(function (jscadTextAlignEnum) {
/**
* Aligns text to the left
*/
jscadTextAlignEnum["left"] = "left";
/**
* Aligns text to the center
*/
jscadTextAlignEnum["center"] = "center";
/**
* Aligns text to the right
*/
jscadTextAlignEnum["right"] = "right";
})(jscadTextAlignEnum = JSCAD.jscadTextAlignEnum || (JSCAD.jscadTextAlignEnum = {}));
class MeshDto {
constructor(mesh) {
if (mesh !== undefined) {
this.mesh = mesh;
}
}
}
JSCAD.MeshDto = MeshDto;
class MeshesDto {
constructor(meshes) {
if (meshes !== undefined) {
this.meshes = meshes;
}
}
}
JSCAD.MeshesDto = MeshesDto;
class DrawSolidMeshDto {
/**
* Provide options without default values
*/
constructor(mesh, opacity, colours, updatable, hidden, jscadMesh) {
/**
* Value between 0 and 1
* @default 1
* @minimum 0
* @maximum 1
* @step 0.1
*/
this.opacity = 1;
/**
* Hex colour string
* @default #444444
*/
this.colours = "#444444";
/**
* Indicates wether this solid will be transformed in time
* @default false
*/
this.updatable = false;
/**
* Hidden
* @default false
*/
this.hidden = false;
if (mesh !== undefined) {
this.mesh = mesh;
}
if (opacity !== undefined) {
this.opacity = opacity;
}
if (colours !== undefined) {
this.colours = colours;
}
if (updatable !== undefined) {
this.updatable = updatable;
}
if (hidden !== undefined) {
this.hidden = hidden;
}
if (jscadMesh !== undefined) {
this.jscadMesh = jscadMesh;
}
}
}
JSCAD.DrawSolidMeshDto = DrawSolidMeshDto;
class DrawSolidMeshesDto {
/**
* Provide options without default values
*/
constructor(meshes, opacity, colours, updatable, hidden, jscadMesh) {
/**
* Value between 0 and 1
* @default 1
* @minimum 0
* @maximum 1
* @step 0.1
*/
this.opacity = 1;
/**
* Hex colour string
* @default #444444
*/
this.colours = "#444444";
/**
* Indicates wether this solid will be transformed in time
* @default false
*/
this.updatable = false;
/**
* Should be hidden
* @default false
*/
this.hidden = false;
if (meshes !== undefined) {
this.meshes = meshes;
}
if (opacity !== undefined) {
this.opacity = opacity;
}
if (colours !== undefined) {
this.colours = colours;
}
if (updatable !== undefined) {
this.updatable = updatable;
}
if (hidden !== undefined) {
this.hidden = hidden;
}
if (jscadMesh !== undefined) {
this.jscadMesh = jscadMesh;
}
}
}
JSCAD.DrawSolidMeshesDto = DrawSolidMeshesDto;
class DrawPathDto {
/**
* Provide options without default values
*/
constructor(path, colour, opacity, width, updatable, pathMesh) {
/**
* Colour of the path
* @default #444444
*/
this.colour = "#444444";
/**
* Opacity of the path
* @default 1
* @minimum 0
* @maximum 1
* @step 0.1
*/
this.opacity = 1;
/**
* Width of the path
* @default 10
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.width = 10;
/**
* Indicates wether the path will change in time
* @default false
*/
this.updatable = false;
if (path !== undefined) {
this.path = path;
}
if (colour !== undefined) {
this.colour = colour;
}
if (opacity !== undefined) {
this.opacity = opacity;
}
if (width !== undefined) {
this.width = width;
}
if (updatable !== undefined) {
this.updatable = updatable;
}
if (pathMesh !== undefined) {
this.pathMesh = pathMesh;
}
}
}
JSCAD.DrawPathDto = DrawPathDto;
class TransformSolidsDto {
constructor(meshes, transformation) {
if (meshes !== undefined) {
this.meshes = meshes;
}
if (transformation !== undefined) {
this.transformation = transformation;
}
}
}
JSCAD.TransformSolidsDto = TransformSolidsDto;
class TransformSolidDto {
constructor(mesh, transformation) {
if (mesh !== undefined) {
this.mesh = mesh;
}
if (transformation !== undefined) {
this.transformation = transformation;
}
}
}
JSCAD.TransformSolidDto = TransformSolidDto;
class DownloadSolidDto {
constructor(mesh, fileName) {
if (mesh !== undefined) {
this.mesh = mesh;
}
if (fileName !== undefined) {
this.fileName = fileName;
}
}
}
JSCAD.DownloadSolidDto = DownloadSolidDto;
class DownloadGeometryDto {
constructor(geometry, fileName, options) {
/**
* File name
* @default jscad-geometry
*/
this.fileName = "jscad-geometry";
if (geometry !== undefined) {
this.geometry = geometry;
}
if (fileName !== undefined) {
this.fileName = fileName;
}
if (options !== undefined) {
this.options = options;
}
}
}
JSCAD.DownloadGeometryDto = DownloadGeometryDto;
class DownloadSolidsDto {
constructor(meshes, fileName) {
if (meshes !== undefined) {
this.meshes = meshes;
}
if (fileName !== undefined) {
this.fileName = fileName;
}
}
}
JSCAD.DownloadSolidsDto = DownloadSolidsDto;
class ColorizeDto {
constructor(geometry, color) {
/**
* Hex color string
* @default #0000ff
*/
this.color = "#0000ff";
if (geometry !== undefined) {
this.geometry = geometry;
}
if (color !== undefined) {
this.color = color;
}
}
}
JSCAD.ColorizeDto = ColorizeDto;
class BooleanObjectsDto {
constructor(meshes) {
if (meshes !== undefined) {
this.meshes = meshes;
}
}
}
JSCAD.BooleanObjectsDto = BooleanObjectsDto;
class BooleanTwoObjectsDto {
constructor(first, second) {
if (first !== undefined) {
this.first = first;
}
if (second !== undefined) {
this.second = second;
}
}
}
JSCAD.BooleanTwoObjectsDto = BooleanTwoObjectsDto;
class BooleanObjectsFromDto {
constructor(from, meshes) {
if (from !== undefined) {
this.from = from;
}
if (meshes !== undefined) {
this.meshes = meshes;
}
}
}
JSCAD.BooleanObjectsFromDto = BooleanObjectsFromDto;
class ExpansionDto {
constructor(geometry, delta, corners, segments) {
/**
* Delta (+/-) of expansion
* @default 0.1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.delta = 0.1;
/**
* Type of corner to create during of expansion; edge, chamfer, round
* @default edge
*/
this.corners = solidCornerTypeEnum.edge;
/**
* Integer number of segments when creating round corners
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (geometry !== undefined) {
this.geometry = geometry;
}
if (delta !== undefined) {
this.delta = delta;
}
if (corners !== undefined) {
this.corners = corners;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.ExpansionDto = ExpansionDto;
class OffsetDto {
constructor(geometry, delta, corners, segments) {
/**
* Delta (+/-) of offset
* @default 0.1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.delta = 0.1;
/**
* Type of corner to create during the offset; edge, chamfer, round.
* @default edge
*/
this.corners = solidCornerTypeEnum.edge;
/**
* Integer number of segments when creating round corners
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (geometry !== undefined) {
this.geometry = geometry;
}
if (delta !== undefined) {
this.delta = delta;
}
if (corners !== undefined) {
this.corners = corners;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.OffsetDto = OffsetDto;
class ExtrudeLinearDto {
constructor(geometry, height, twistAngle, twistSteps) {
/**
* Height of linear extrude
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Twist angle in degrees
* @default 90
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.twistAngle = 90;
/**
* Number of twist steps
* @default 15
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.twistSteps = 15;
if (geometry !== undefined) {
this.geometry = geometry;
}
if (height !== undefined) {
this.height = height;
}
if (twistAngle !== undefined) {
this.twistAngle = twistAngle;
}
if (twistSteps !== undefined) {
this.twistSteps = twistSteps;
}
}
}
JSCAD.ExtrudeLinearDto = ExtrudeLinearDto;
class HullDto {
constructor(meshes) {
if (meshes !== undefined) {
this.meshes = meshes;
}
}
}
JSCAD.HullDto = HullDto;
class ExtrudeRectangularDto {
constructor(geometry, height, size) {
/**
* Height of linear extrude
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Size of the rectangle
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.size = 1;
if (geometry !== undefined) {
this.geometry = geometry;
}
if (height !== undefined) {
this.height = height;
}
if (size !== undefined) {
this.size = size;
}
}
}
JSCAD.ExtrudeRectangularDto = ExtrudeRectangularDto;
class ExtrudeRectangularPointsDto {
constructor(points, height, size) {
/**
* Height of linear extrude
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Size of the rectangle
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.size = 1;
if (points !== undefined) {
this.points = points;
}
if (height !== undefined) {
this.height = height;
}
if (size !== undefined) {
this.size = size;
}
}
}
JSCAD.ExtrudeRectangularPointsDto = ExtrudeRectangularPointsDto;
class ExtrudeRotateDto {
constructor(polygon, angle, startAngle, segments) {
/**
* Angle in degrees
* @default 90
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.angle = 90;
/**
* Start angle in degrees
* @default 0
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.startAngle = 0;
/**
* Number of segments
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (polygon !== undefined) {
this.polygon = polygon;
}
if (angle !== undefined) {
this.angle = angle;
}
if (startAngle !== undefined) {
this.startAngle = startAngle;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.ExtrudeRotateDto = ExtrudeRotateDto;
class PolylineDto {
constructor(polyline) {
if (polyline !== undefined) {
this.polyline = polyline;
}
}
}
JSCAD.PolylineDto = PolylineDto;
class CurveDto {
constructor(curve) {
if (curve !== undefined) {
this.curve = curve;
}
}
}
JSCAD.CurveDto = CurveDto;
class PointsDto {
constructor(points) {
if (points !== undefined) {
this.points = points;
}
}
}
JSCAD.PointsDto = PointsDto;
class PathDto {
constructor(path) {
if (path !== undefined) {
this.path = path;
}
}
}
JSCAD.PathDto = PathDto;
class PathFromPointsDto {
constructor(points, closed) {
/**
* Indicates wether we want to create a closed path
* @default false
*/
this.closed = false;
if (points !== undefined) {
this.points = points;
}
if (closed !== undefined) {
this.closed = closed;
}
}
}
JSCAD.PathFromPointsDto = PathFromPointsDto;
class PathsFromPointsDto {
constructor(pointsLists) {
if (pointsLists !== undefined) {
this.pointsLists = pointsLists;
}
}
}
JSCAD.PathsFromPointsDto = PathsFromPointsDto;
class PathFromPolylineDto {
constructor(polyline, closed) {
/**
* Indicates wether we want to create a closed path
* @default false
*/
this.closed = false;
if (polyline !== undefined) {
this.polyline = polyline;
}
if (closed !== undefined) {
this.closed = closed;
}
}
}
JSCAD.PathFromPolylineDto = PathFromPolylineDto;
class PathAppendCurveDto {
constructor(curve, path) {
if (curve !== undefined) {
this.curve = curve;
}
if (path !== undefined) {
this.path = path;
}
}
}
JSCAD.PathAppendCurveDto = PathAppendCurveDto;
class PathAppendPointsDto {
constructor(points, path) {
if (points !== undefined) {
this.points = points;
}
if (path !== undefined) {
this.path = path;
}
}
}
JSCAD.PathAppendPointsDto = PathAppendPointsDto;
class PathAppendPolylineDto {
constructor(polyline, path) {
if (polyline !== undefined) {
this.polyline = polyline;
}
if (path !== undefined) {
this.path = path;
}
}
}
JSCAD.PathAppendPolylineDto = PathAppendPolylineDto;
class PathAppendArcDto {
constructor(path, endPoint, xAxisRotation, clockwise, large, segments, radiusX, radiusY) {
/**
* End point of an arc
* @default [1, 1]
*/
this.endPoint = [1, 1];
/**
* Rotation (degrees) of the X axis of the arc with respect to the X axis of the coordinate system
* @default 90
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.xAxisRotation = 90;
/**
* Draw an arc clockwise with respect to the center point
* @default true
*/
this.clockwise = true;
/**
* Draw an arc longer than PI radians
* @default false
*/
this.large = false;
/**
* Number of segments for the arc
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
/**
* X radius of an arc
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.radiusX = 1;
/**
* Y radius of an arc
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.radiusY = 1;
if (path !== undefined) {
this.path = path;
}
if (endPoint !== undefined) {
this.endPoint = endPoint;
}
if (xAxisRotation !== undefined) {
this.xAxisRotation = xAxisRotation;
}
if (clockwise !== undefined) {
this.clockwise = clockwise;
}
if (large !== undefined) {
this.large = large;
}
if (segments !== undefined) {
this.segments = segments;
}
if (radiusX !== undefined) {
this.radiusX = radiusX;
}
if (radiusY !== undefined) {
this.radiusY = radiusY;
}
}
}
JSCAD.PathAppendArcDto = PathAppendArcDto;
class CircleDto {
constructor(center, radius, segments) {
/**
* Center of the circle
* @default [0, 0]
*/
this.center = [0, 0];
/**
* Radius of the circle
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Segment number
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.CircleDto = CircleDto;
class EllipseDto {
constructor(center, radius, segments) {
/**
* Center of the circle
* @default [0, 0]
*/
this.center = [0, 0];
/**
* Radius of the circle in [x, y] form
* @default [1, 2]
*/
this.radius = [1, 2];
/**
* Segment number
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.EllipseDto = EllipseDto;
class SquareDto {
constructor(center, size) {
/**
* Center of the 2D square
* @default [0, 0]
*/
this.center = [0, 0];
/**
* Size of the square
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.size = 1;
if (center !== undefined) {
this.center = center;
}
if (size !== undefined) {
this.size = size;
}
}
}
JSCAD.SquareDto = SquareDto;
class RectangleDto {
constructor(center, width, length) {
/**
* Center of the 2D rectangle
* @default [0, 0]
*/
this.center = [0, 0];
/**
* Width of the rectangle
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.width = 1;
/**
* Length of the rectangle
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.length = 1;
if (center !== undefined) {
this.center = center;
}
if (width !== undefined) {
this.width = width;
}
if (length !== undefined) {
this.length = length;
}
}
}
JSCAD.RectangleDto = RectangleDto;
class RoundedRectangleDto {
constructor(center, roundRadius, segments, width, length) {
/**
* Center of the 2D rectangle
* @default [0, 0]
*/
this.center = [0, 0];
/**
* The radius to round the rectangle edge
* @default 0.2
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.roundRadius = 0.2;
/**
* Number of segments for corners
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
/**
* Width of the rectangle
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.width = 1;
/**
* Length of the rectangle
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.length = 1;
if (center !== undefined) {
this.center = center;
}
if (roundRadius !== undefined) {
this.roundRadius = roundRadius;
}
if (segments !== undefined) {
this.segments = segments;
}
if (width !== undefined) {
this.width = width;
}
if (length !== undefined) {
this.length = length;
}
}
}
JSCAD.RoundedRectangleDto = RoundedRectangleDto;
class StarDto {
constructor(center, vertices, density, outerRadius, innerRadius, startAngle) {
/**
* Center of the 2D star
* @default [0, 0]
*/
this.center = [0, 0];
/**
* Number of vertices on the star
* @default 10
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.vertices = 10;
/**
* Density of the star
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.density = 1;
/**
* Outer radius of the star
* @default 2
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.outerRadius = 2;
/**
* Inner radius of the star
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.innerRadius = 1;
/**
* Starting angle for first vertice, in degrees
* @default 0
* @minimum -Infinity
* @maximum Infinity
* @step 1
*/
this.startAngle = 0;
if (center !== undefined) {
this.center = center;
}
if (vertices !== undefined) {
this.vertices = vertices;
}
if (density !== undefined) {
this.density = density;
}
if (outerRadius !== undefined) {
this.outerRadius = outerRadius;
}
if (innerRadius !== undefined) {
this.innerRadius = innerRadius;
}
if (startAngle !== undefined) {
this.startAngle = startAngle;
}
}
}
JSCAD.StarDto = StarDto;
class CubeDto {
constructor(center, size) {
/**
* Center coordinates of the cube
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Size of the cube
* @default 1
* @minimum -Infinity
* @maximum Infinity
* @step 0.1
*/
this.size = 1;
if (center !== undefined) {
this.center = center;
}
if (size !== undefined) {
this.size = size;
}
}
}
JSCAD.CubeDto = CubeDto;
class CubeCentersDto {
constructor(centers, size) {
/**
* Size of the cube
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.size = 1;
if (centers !== undefined) {
this.centers = centers;
}
if (size !== undefined) {
this.size = size;
}
}
}
JSCAD.CubeCentersDto = CubeCentersDto;
class CuboidDto {
constructor(center, width, length, height) {
/**
* Center coordinates of the cubod
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Width of the cuboid
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.width = 1;
/**
* Length of the cuboid
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.length = 1;
/**
* Height of the cuboid
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
if (center !== undefined) {
this.center = center;
}
if (width !== undefined) {
this.width = width;
}
if (length !== undefined) {
this.length = length;
}
if (height !== undefined) {
this.height = height;
}
}
}
JSCAD.CuboidDto = CuboidDto;
class CuboidCentersDto {
constructor(centers, width, length, height) {
/**
* Width of the cuboids
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.width = 1;
/**
* Length of the cuboids
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.length = 1;
/**
* Height of the cuboids
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
if (centers !== undefined) {
this.centers = centers;
}
if (width !== undefined) {
this.width = width;
}
if (length !== undefined) {
this.length = length;
}
if (height !== undefined) {
this.height = height;
}
}
}
JSCAD.CuboidCentersDto = CuboidCentersDto;
class RoundedCuboidDto {
constructor(center, roundRadius, width, length, height, segments) {
/**
* Center coordinates of the cubod
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Radius for rounding edges
* @default 0.1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.roundRadius = 1;
/**
* Width of the cuboid
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.width = 1;
/**
* Length of the cuboid
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.length = 1;
/**
* Height of the cuboid
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Segments of rounded edges
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (roundRadius !== undefined) {
this.roundRadius = roundRadius;
}
if (width !== undefined) {
this.width = width;
}
if (length !== undefined) {
this.length = length;
}
if (height !== undefined) {
this.height = height;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.RoundedCuboidDto = RoundedCuboidDto;
class RoundedCuboidCentersDto {
constructor(centers, roundRadius, width, length, height, segments) {
/**
* Radius for rounding edges
* @default 0.1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.roundRadius = 0.1;
/**
* Width of the cuboids
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.width = 1;
/**
* Length of the cuboids
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.length = 1;
/**
* Height of the cuboids
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Segments of rounded edges
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (centers !== undefined) {
this.centers = centers;
}
if (roundRadius !== undefined) {
this.roundRadius = roundRadius;
}
if (width !== undefined) {
this.width = width;
}
if (length !== undefined) {
this.length = length;
}
if (height !== undefined) {
this.height = height;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.RoundedCuboidCentersDto = RoundedCuboidCentersDto;
class CylidnerEllipticDto {
constructor(center, height, startRadius, endRadius, segments) {
/**
* Center of the cylinder
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Height of the cylinder
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Start radius on X and Y directions
* @default [1, 2]
*/
this.startRadius = [1, 2];
/**
* End radius on X and Y directions
* @default [2, 3]
*/
this.endRadius = [2, 3];
/**
* Subdivision segments
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (height !== undefined) {
this.height = height;
}
if (startRadius !== undefined) {
this.startRadius = startRadius;
}
if (endRadius !== undefined) {
this.endRadius = endRadius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.CylidnerEllipticDto = CylidnerEllipticDto;
class CylidnerCentersEllipticDto {
constructor(centers, height, startRadius, endRadius, segments) {
/**
* Height of the cylinders
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Start radius on X and Y directions
* @default [1, 2]
*/
this.startRadius = [1, 2];
/**
* End radius on X and Y directions
* @default [2, 3]
*/
this.endRadius = [2, 3];
/**
* Subdivision segments
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (centers !== undefined) {
this.centers = centers;
}
if (height !== undefined) {
this.height = height;
}
if (startRadius !== undefined) {
this.startRadius = startRadius;
}
if (endRadius !== undefined) {
this.endRadius = endRadius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.CylidnerCentersEllipticDto = CylidnerCentersEllipticDto;
class CylidnerDto {
constructor(center, height, radius, segments) {
/**
* Center of the cylinder
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Height of the cylinder
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Radius of the cylinder
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Subdivision segments
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (height !== undefined) {
this.height = height;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.CylidnerDto = CylidnerDto;
class RoundedCylidnerDto {
constructor(center, roundRadius, height, radius, segments) {
/**
* Center of the cylinder
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Rounding radius
* @default 0.1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.roundRadius = 0.1;
/**
* Height of the cylinder
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Radius of the cylinder
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Segment number
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (roundRadius !== undefined) {
this.roundRadius = roundRadius;
}
if (height !== undefined) {
this.height = height;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.RoundedCylidnerDto = RoundedCylidnerDto;
class EllipsoidDto {
constructor(center, radius, segments) {
/**
* Center coordinates
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Radius of the ellipsoid in [x, y, z] form
* @default [1, 2, 3]
*/
this.radius = [1, 2, 3];
/**
* Segment count for ellipsoid
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.EllipsoidDto = EllipsoidDto;
class EllipsoidCentersDto {
constructor(centers, radius, segments) {
/**
* Radius of the ellipsoid in [x, y, z] form
* @default [1, 2, 3]
*/
this.radius = [1, 2, 3];
/**
* Segment count for ellipsoid
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (centers !== undefined) {
this.centers = centers;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.EllipsoidCentersDto = EllipsoidCentersDto;
class GeodesicSphereDto {
constructor(center, radius, frequency) {
/**
* Center coordinate of the geodesic sphere
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Radius of the sphere
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Subdivision count
* @default 12
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.frequency = 12;
if (center !== undefined) {
this.center = center;
}
if (radius !== undefined) {
this.radius = radius;
}
if (frequency !== undefined) {
this.frequency = frequency;
}
}
}
JSCAD.GeodesicSphereDto = GeodesicSphereDto;
class GeodesicSphereCentersDto {
constructor(centers, radius, frequency) {
/**
* Radius of the sphere
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Subdivision count
* @default 12
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.frequency = 12;
if (centers !== undefined) {
this.centers = centers;
}
if (radius !== undefined) {
this.radius = radius;
}
if (frequency !== undefined) {
this.frequency = frequency;
}
}
}
JSCAD.GeodesicSphereCentersDto = GeodesicSphereCentersDto;
class CylidnerCentersDto {
constructor(centers, height, radius, segments) {
/**
* Height of the cylinders
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Radius of the cylinders
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Subdivision segments
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (centers !== undefined) {
this.centers = centers;
}
if (height !== undefined) {
this.height = height;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.CylidnerCentersDto = CylidnerCentersDto;
class RoundedCylidnerCentersDto {
constructor(centers, roundRadius, height, radius, segments) {
/**
* Rounding radius
* @default 0.1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.roundRadius = 0.1;
/**
* Height of the cylinders
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.height = 1;
/**
* Radius of the cylinders
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Segment number
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (centers !== undefined) {
this.centers = centers;
}
if (roundRadius !== undefined) {
this.roundRadius = roundRadius;
}
if (height !== undefined) {
this.height = height;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.RoundedCylidnerCentersDto = RoundedCylidnerCentersDto;
class SphereDto {
constructor(center, radius, segments) {
/**
* Center point of the sphere
* @default [0, 0, 0]
*/
this.center = [0, 0, 0];
/**
* Radius of the sphere
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Segment count
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (center !== undefined) {
this.center = center;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.SphereDto = SphereDto;
class SphereCentersDto {
constructor(centers, radius, segments) {
/**
* Radius of the spheres
* @default 1
* @minimum 0
* @maximum Infinity
* @step 0.1
*/
this.radius = 1;
/**
* Segment count
* @default 24
* @minimum 0
* @maximum Infinity
* @step 1
*/
this.segments = 24;
if (centers !== undefined) {
this.centers = centers;
}
if (radius !== undefined) {
this.radius = radius;
}
if (segments !== undefined) {
this.segments = segments;
}
}
}
JSCAD.SphereCentersDto = SphereCentersDto;
class TorusDto {
constructor(center, innerRadius, outerRadius, innerSegments, outerSegments, innerRotation, outerRotation, startAngle) {
/**
* Center coordinate
* @default [0, 0, 0]
*/