UNPKG

@bitbybit-dev/manifold

Version:

Bit By Bit Developers Manifold based CAD Library to Program Geometry

1,477 lines (1,476 loc) 47.8 kB
// tslint:disable-next-line: no-namespace export var Manifold; (function (Manifold) { let fillRuleEnum; (function (fillRuleEnum) { fillRuleEnum["evenOdd"] = "EvenOdd"; fillRuleEnum["nonZero"] = "NonZero"; fillRuleEnum["positive"] = "Positive"; fillRuleEnum["negative"] = "Negative"; })(fillRuleEnum = Manifold.fillRuleEnum || (Manifold.fillRuleEnum = {})); let manifoldJoinTypeEnum; (function (manifoldJoinTypeEnum) { manifoldJoinTypeEnum["square"] = "Square"; manifoldJoinTypeEnum["round"] = "Round"; manifoldJoinTypeEnum["miter"] = "Miter"; manifoldJoinTypeEnum["bevel"] = "Bevel"; })(manifoldJoinTypeEnum = Manifold.manifoldJoinTypeEnum || (Manifold.manifoldJoinTypeEnum = {})); class DecomposedManifoldMeshDto { } Manifold.DecomposedManifoldMeshDto = DecomposedManifoldMeshDto; class DrawManifoldOrCrossSectionDto { /** * Provide options without default values */ constructor(manifoldOrCrossSection, faceOpacity, faceMaterial, faceColour, crossSectionColour, crossSectionWidth, crossSectionOpacity, computeNormals, drawTwoSided, backFaceColour, backFaceOpacity) { /** * Face opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ this.faceOpacity = 1; /** * Hex colour string for face colour * @default #ff0000 */ this.faceColour = "#ff0000"; /** * Hex colour string for cross section drawing * @default #ff00ff */ this.crossSectionColour = "#ff00ff"; /** * Width of cross section lines * @default 2 */ this.crossSectionWidth = 2; /** * Cross section opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ this.crossSectionOpacity = 1; /** * Compute normals for the shape * @default false */ this.computeNormals = false; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. * @default true */ this.drawTwoSided = true; /** * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true. * @default #0000ff */ this.backFaceColour = "#0000ff"; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ this.backFaceOpacity = 1; if (manifoldOrCrossSection !== undefined) { this.manifoldOrCrossSection = manifoldOrCrossSection; } if (faceOpacity !== undefined) { this.faceOpacity = faceOpacity; } if (faceMaterial !== undefined) { this.faceMaterial = faceMaterial; } if (faceColour !== undefined) { this.faceColour = faceColour; } if (crossSectionColour !== undefined) { this.crossSectionColour = crossSectionColour; } if (crossSectionWidth !== undefined) { this.crossSectionWidth = crossSectionWidth; } if (crossSectionOpacity !== undefined) { this.crossSectionOpacity = crossSectionOpacity; } if (computeNormals !== undefined) { this.computeNormals = computeNormals; } if (drawTwoSided !== undefined) { this.drawTwoSided = drawTwoSided; } if (backFaceColour !== undefined) { this.backFaceColour = backFaceColour; } if (backFaceOpacity !== undefined) { this.backFaceOpacity = backFaceOpacity; } } } Manifold.DrawManifoldOrCrossSectionDto = DrawManifoldOrCrossSectionDto; class DrawManifoldsOrCrossSectionsDto { /** * Provide options without default values */ constructor(manifoldsOrCrossSections, faceOpacity, faceMaterial, faceColour, crossSectionColour, crossSectionWidth, crossSectionOpacity, computeNormals, drawTwoSided, backFaceColour, backFaceOpacity) { /** * Hex colour string for face colour * @default #ff0000 */ this.faceColour = "#ff0000"; /** * Face opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ this.faceOpacity = 1; /** * Hex colour string for cross section drawing * @default #ff00ff */ this.crossSectionColour = "#ff00ff"; /** * Width of cross section lines * @default 2 */ this.crossSectionWidth = 2; /** * Cross section opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ this.crossSectionOpacity = 1; /** * Compute normals for the shape * @default false */ this.computeNormals = false; /** * Draw two-sided faces with different colors for front and back. This helps visualize face orientation. * @default true */ this.drawTwoSided = true; /** * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true. * @default #0000ff */ this.backFaceColour = "#0000ff"; /** * Back face opacity value between 0 and 1. Only used when drawTwoSided is true. * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ this.backFaceOpacity = 1; if (manifoldsOrCrossSections !== undefined) { this.manifoldsOrCrossSections = manifoldsOrCrossSections; } if (faceOpacity !== undefined) { this.faceOpacity = faceOpacity; } if (faceMaterial !== undefined) { this.faceMaterial = faceMaterial; } if (faceColour !== undefined) { this.faceColour = faceColour; } if (crossSectionColour !== undefined) { this.crossSectionColour = crossSectionColour; } if (crossSectionWidth !== undefined) { this.crossSectionWidth = crossSectionWidth; } if (crossSectionOpacity !== undefined) { this.crossSectionOpacity = crossSectionOpacity; } if (computeNormals !== undefined) { this.computeNormals = computeNormals; } if (drawTwoSided !== undefined) { this.drawTwoSided = drawTwoSided; } if (backFaceColour !== undefined) { this.backFaceColour = backFaceColour; } if (backFaceOpacity !== undefined) { this.backFaceOpacity = backFaceOpacity; } } } Manifold.DrawManifoldsOrCrossSectionsDto = DrawManifoldsOrCrossSectionsDto; class CreateFromMeshDto { constructor(mesh) { if (mesh !== undefined) { this.mesh = mesh; } } } Manifold.CreateFromMeshDto = CreateFromMeshDto; class FromPolygonPointsDto { constructor(polygonPoints) { if (polygonPoints !== undefined) { this.polygonPoints = polygonPoints; } } } Manifold.FromPolygonPointsDto = FromPolygonPointsDto; class CrossSectionFromPolygonPointsDto { constructor(points, fillRule, removeDuplicates, tolerance) { /** * Fill rule for polygon interpretation * @default positive */ this.fillRule = fillRuleEnum.positive; /** * Remove consecutive duplicate points before creating polygon * @default false */ this.removeDuplicates = false; /** * Tolerance for duplicate removal * @default 1e-7 */ this.tolerance = 1e-7; if (points !== undefined) { this.points = points; } if (fillRule !== undefined) { this.fillRule = fillRule; } if (removeDuplicates !== undefined) { this.removeDuplicates = removeDuplicates; } if (tolerance !== undefined) { this.tolerance = tolerance; } } } Manifold.CrossSectionFromPolygonPointsDto = CrossSectionFromPolygonPointsDto; class CrossSectionFromPolygonsPointsDto { constructor(polygonPoints, fillRule, removeDuplicates, tolerance) { /** * Fill rule for polygon interpretation * @default positive */ this.fillRule = fillRuleEnum.positive; /** * Remove consecutive duplicate points before creating polygons * @default false */ this.removeDuplicates = false; /** * Tolerance for duplicate removal * @default 1e-7 */ this.tolerance = 1e-7; if (polygonPoints !== undefined) { this.polygonPoints = polygonPoints; } if (fillRule !== undefined) { this.fillRule = fillRule; } if (removeDuplicates !== undefined) { this.removeDuplicates = removeDuplicates; } if (tolerance !== undefined) { this.tolerance = tolerance; } } } Manifold.CrossSectionFromPolygonsPointsDto = CrossSectionFromPolygonsPointsDto; class CubeDto { constructor(center, size) { /** * Place cube on the center * @default true */ this.center = true; /** * Size of the cube * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.size = 1; if (center !== undefined) { this.center = center; } if (size !== undefined) { this.size = size; } } } Manifold.CubeDto = CubeDto; class CreateContourSectionDto { constructor(polygons, fillRule) { /** * Fill rule for the contour section * @default EvenOdd */ this.fillRule = fillRuleEnum.evenOdd; if (polygons !== undefined) { this.polygons = polygons; } if (fillRule !== undefined) { this.fillRule = fillRule; } } } Manifold.CreateContourSectionDto = CreateContourSectionDto; class SquareDto { constructor(center, size) { /** * Place cube on the center * @default false */ this.center = false; /** * Size of the cube * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.size = 1; if (center !== undefined) { this.center = center; } if (size !== undefined) { this.size = size; } } } Manifold.SquareDto = SquareDto; class SphereDto { constructor(radius, circularSegments) { /** * Radius of the sphere * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.radius = 1; if (radius !== undefined) { this.radius = radius; } if (circularSegments !== undefined) { this.circularSegments = circularSegments; } } } Manifold.SphereDto = SphereDto; class CylinderDto { constructor(height, radiusLow, radiusHigh, circularSegments, center) { /** * 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.radiusLow = 1; /** * Radius of the cylinder * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.radiusHigh = 1; /** * Circular segments of the cylinder * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ this.circularSegments = 32; /** * Place cylinder on the center * @default true */ this.center = true; if (height !== undefined) { this.height = height; } if (radiusLow !== undefined) { this.radiusLow = radiusLow; } if (radiusHigh !== undefined) { this.radiusHigh = radiusHigh; } if (circularSegments !== undefined) { this.circularSegments = circularSegments; } if (center !== undefined) { this.center = center; } } } Manifold.CylinderDto = CylinderDto; class CircleDto { constructor(radius, circularSegments) { /** * Radius of the cylinder * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.radius = 1; /** * Circular segments of the cylinder * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ this.circularSegments = 32; if (radius !== undefined) { this.radius = radius; } if (circularSegments !== undefined) { this.circularSegments = circularSegments; } } } Manifold.CircleDto = CircleDto; class RectangleDto { constructor(length, height, center) { /** * Length of the rectangle * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.length = 1; /** * Height of the rectangle * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.height = 1; /** * Place rectangle on the center * @default false */ this.center = false; if (length !== undefined) { this.length = length; } if (height !== undefined) { this.height = height; } if (center !== undefined) { this.center = center; } } } Manifold.RectangleDto = RectangleDto; class ManifoldDto { constructor(manifold) { if (manifold !== undefined) { this.manifold = manifold; } } } Manifold.ManifoldDto = ManifoldDto; class CalculateNormalsDto { constructor(manifold, normalIdx, minSharpAngle) { /** * The property channel in which to store the X * values of the normals. The X, Y, and Z channels will be sequential. The * property set will be automatically expanded to include up through normalIdx * + 2. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ this.normalIdx = 0; /** * Any edges with angles greater than this value will * remain sharp, getting different normal vector properties on each side of * the edge. By default, no edges are sharp and all normals are shared. With a * value of zero, the model is faceted and all normals match their triangle * normals, but in this case it would be better not to calculate normals at * all. The value is in degrees. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ this.minSharpAngle = 0; if (manifold !== undefined) { this.manifold = manifold; } if (normalIdx !== undefined) { this.normalIdx = normalIdx; } if (minSharpAngle !== undefined) { this.minSharpAngle = minSharpAngle; } } } Manifold.CalculateNormalsDto = CalculateNormalsDto; class CalculateCurvatureDto { constructor(manifold) { if (manifold !== undefined) { this.manifold = manifold; } } } Manifold.CalculateCurvatureDto = CalculateCurvatureDto; class CountDto { constructor(count) { if (count !== undefined) { this.count = count; } } } Manifold.CountDto = CountDto; class ManifoldsMinGapDto { constructor(manifold1, manifold2, searchLength) { /** * Length of the search gap * @default 100 * @minimum 0 * @maximum Infinity * @step 10 */ this.searchLength = 100; if (manifold1 !== undefined) { this.manifold1 = manifold1; } if (manifold2 !== undefined) { this.manifold2 = manifold2; } if (searchLength !== undefined) { this.searchLength = searchLength; } } } Manifold.ManifoldsMinGapDto = ManifoldsMinGapDto; class ManifoldRefineToleranceDto { constructor(manifold, tolerance) { /** * The desired maximum distance between the faceted mesh * produced and the exact smoothly curving surface. All vertices are exactly * on the surface, within rounding error. * @default 1e-6 * @minimum 0 * @maximum Infinity * @step 1e-7 */ this.tolerance = 1e-6; if (manifold !== undefined) { this.manifold = manifold; } if (tolerance !== undefined) { this.tolerance = tolerance; } } } Manifold.ManifoldRefineToleranceDto = ManifoldRefineToleranceDto; class ManifoldRefineLengthDto { constructor(manifold, length) { /** * Length of the manifold * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.length = 0.1; if (manifold !== undefined) { this.manifold = manifold; } if (length !== undefined) { this.length = length; } } } Manifold.ManifoldRefineLengthDto = ManifoldRefineLengthDto; class ManifoldRefineDto { constructor(manifold, number) { /** * The number of pieces to split every edge into. Must be > 1. * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ this.number = 1; if (manifold !== undefined) { this.manifold = manifold; } if (number !== undefined) { this.number = number; } } } Manifold.ManifoldRefineDto = ManifoldRefineDto; class ManifoldSmoothByNormalsDto { constructor(manifold, normalIdx) { /** * The first property channel of the normals. NumProp must be * at least normalIdx + 3. Any vertex where multiple normals exist and don't * agree will result in a sharp edge. * @default 0 * @minimum 0 * @maximum Infinity * @step 1 */ this.normalIdx = 0; if (manifold !== undefined) { this.manifold = manifold; } if (normalIdx !== undefined) { this.normalIdx = normalIdx; } } } Manifold.ManifoldSmoothByNormalsDto = ManifoldSmoothByNormalsDto; class ManifoldSimplifyDto { constructor(manifold, tolerance) { if (manifold !== undefined) { this.manifold = manifold; } if (tolerance !== undefined) { this.tolerance = tolerance; } } } Manifold.ManifoldSimplifyDto = ManifoldSimplifyDto; class ManifoldSetPropertiesDto { constructor(manifold, numProp, propFunc) { /** * The new number of properties per vertex * @default 3 * @minimum 3 * @maximum Infinity * @step 1 */ this.numProp = 3; if (manifold !== undefined) { this.manifold = manifold; } if (numProp !== undefined) { this.numProp = numProp; } if (propFunc !== undefined) { this.propFunc = propFunc; } } } Manifold.ManifoldSetPropertiesDto = ManifoldSetPropertiesDto; class ManifoldSmoothOutDto { constructor(manifold, minSharpAngle, minSmoothness) { /** * Any edges with angles greater * than this value will remain sharp. The rest will be smoothed to G1 * continuity, with the caveat that flat faces of three or more triangles will * always remain flat. With a value of zero, the model is faceted, but in this * case there is no point in smoothing. * @default 60 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.minSharpAngle = 60; /** * The smoothness applied to * sharp angles. The default gives a hard edge, while values > 0 will give a * small fillet on these sharp edges. A value of 1 is equivalent to a * minSharpAngle of 180 - all edges will be smooth. * @default 0 * @minimum 0 * @maximum 1 * @step 0.1 */ this.minSmoothness = 0; if (manifold !== undefined) { this.manifold = manifold; } if (minSharpAngle !== undefined) { this.minSharpAngle = minSharpAngle; } if (minSmoothness !== undefined) { this.minSmoothness = minSmoothness; } } } Manifold.ManifoldSmoothOutDto = ManifoldSmoothOutDto; class HullPointsDto { constructor(points) { if (points !== undefined) { this.points = points; } } } Manifold.HullPointsDto = HullPointsDto; class SliceDto { constructor(manifold) { /** * Height of the slice * @default 0.5 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.height = 0.5; if (manifold !== undefined) { this.manifold = manifold; } } } Manifold.SliceDto = SliceDto; class MeshDto { constructor(mesh) { if (mesh !== undefined) { this.mesh = mesh; } } } Manifold.MeshDto = MeshDto; class MeshVertexIndexDto { constructor(mesh, vertexIndex) { if (mesh !== undefined) { this.mesh = mesh; } if (vertexIndex !== undefined) { this.vertexIndex = vertexIndex; } } } Manifold.MeshVertexIndexDto = MeshVertexIndexDto; class MeshTriangleRunIndexDto { constructor(mesh, triangleRunIndex) { if (mesh !== undefined) { this.mesh = mesh; } if (triangleRunIndex !== undefined) { this.triangleRunIndex = triangleRunIndex; } } } Manifold.MeshTriangleRunIndexDto = MeshTriangleRunIndexDto; class MeshHalfEdgeIndexDto { constructor(mesh, halfEdgeIndex) { if (mesh !== undefined) { this.mesh = mesh; } if (halfEdgeIndex !== undefined) { this.halfEdgeIndex = halfEdgeIndex; } } } Manifold.MeshHalfEdgeIndexDto = MeshHalfEdgeIndexDto; class MeshTriangleIndexDto { constructor(mesh, triangleIndex) { if (mesh !== undefined) { this.mesh = mesh; } if (triangleIndex !== undefined) { this.triangleIndex = triangleIndex; } } } Manifold.MeshTriangleIndexDto = MeshTriangleIndexDto; class CrossSectionDto { constructor(crossSection) { if (crossSection !== undefined) { this.crossSection = crossSection; } } } Manifold.CrossSectionDto = CrossSectionDto; class CrossSectionsDto { constructor(crossSections) { if (crossSections !== undefined) { this.crossSections = crossSections; } } } Manifold.CrossSectionsDto = CrossSectionsDto; class ExtrudeDto { constructor(crossSection) { /** * Height of the extrusion * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.height = 1; /** * Number of divisions * @default 1 * @minimum 0 * @maximum Infinity * @step 1 */ this.nDivisions = 1; /** * Twist degrees * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.twistDegrees = 0; /** * Scale top * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.scaleTopX = 1; /** * Scale top * @default 1 * @minimum 0 * @maximum Infinity * @step 0.1 */ this.scaleTopY = 1; /** * Center the extrusion * @default true */ this.center = true; if (crossSection !== undefined) { this.crossSection = crossSection; } } } Manifold.ExtrudeDto = ExtrudeDto; class RevolveDto { constructor(crossSection, revolveDegrees, matchProfile, circularSegments) { /** * Default manifold library will adjust profile when generating revolved shape. We prefer it to be matching the profile by default. Set to false to use default manifold library behavior. * @default true */ this.matchProfile = true; /** * Circular segments * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ this.circularSegments = 32; if (crossSection !== undefined) { this.crossSection = crossSection; } if (revolveDegrees !== undefined) { this.revolveDegrees = revolveDegrees; } if (matchProfile !== undefined) { this.matchProfile = matchProfile; } if (circularSegments !== undefined) { this.circularSegments = circularSegments; } } } Manifold.RevolveDto = RevolveDto; class OffsetDto { constructor(crossSection, delta, joinType, miterLimit, circularSegments) { /** * The join type specifying the treatment of contour joins * (corners). * @default round */ this.joinType = manifoldJoinTypeEnum.round; /** * The maximum distance in multiples of delta that vertices * can be offset from their original positions with before squaring is * applied, **when the join type is Miter** (default is 2, which is the * minimum allowed). See the [Clipper2 * MiterLimit](http://www.angusj.com/clipper2/Docs/Units/Clipper.Offset/Classes/ClipperOffset/Properties/MiterLimit.htm) * page for a visual example. * @default 2 * @minimum 2 * @maximum Infinity * @step 0.1 */ this.miterLimit = 2; /** * Number of segments per 360 degrees of * <B>JoinType::Round</B> corners (roughly, the number of vertices that * will be added to each contour). Default is calculated by the static Quality * defaults according to the radius. * @default 32 * @minimum 0 * @maximum Infinity * @step 1 */ this.circularSegments = 32; if (crossSection !== undefined) { this.crossSection = crossSection; } if (delta !== undefined) { this.delta = delta; } if (joinType !== undefined) { this.joinType = joinType; } if (miterLimit !== undefined) { this.miterLimit = miterLimit; } if (circularSegments !== undefined) { this.circularSegments = circularSegments; } } } Manifold.OffsetDto = OffsetDto; class SimplifyDto { constructor(crossSection, epsilon) { /** * Extrude cross section shape * @default 1e-6 * @minimum 0 * @maximum Infinity * @step 1e-7 */ this.epsilon = 1e-6; if (crossSection !== undefined) { this.crossSection = crossSection; } if (epsilon !== undefined) { this.epsilon = epsilon; } } } Manifold.SimplifyDto = SimplifyDto; class ComposeDto { constructor(polygons) { if (polygons !== undefined) { this.polygons = polygons; } } } Manifold.ComposeDto = ComposeDto; class MirrorCrossSectionDto { constructor(crossSection, normal) { /** * The normal vector of the plane to be mirrored over * @default [1,0] */ this.normal = [1, 0]; if (crossSection !== undefined) { this.crossSection = crossSection; } if (normal !== undefined) { this.normal = normal; } } } Manifold.MirrorCrossSectionDto = MirrorCrossSectionDto; class Scale2DCrossSectionDto { constructor(crossSection, vector) { /** * The normal vector of the plane to be mirrored over * @default [2,2] */ this.vector = [2, 2]; if (crossSection !== undefined) { this.crossSection = crossSection; } if (vector !== undefined) { this.vector = vector; } } } Manifold.Scale2DCrossSectionDto = Scale2DCrossSectionDto; class TranslateCrossSectionDto { constructor(crossSection, vector) { if (crossSection !== undefined) { this.crossSection = crossSection; } if (vector !== undefined) { this.vector = vector; } } } Manifold.TranslateCrossSectionDto = TranslateCrossSectionDto; class RotateCrossSectionDto { constructor(crossSection, degrees) { if (crossSection !== undefined) { this.crossSection = crossSection; } if (degrees !== undefined) { this.degrees = degrees; } } } Manifold.RotateCrossSectionDto = RotateCrossSectionDto; class ScaleCrossSectionDto { constructor(crossSection, factor) { /** * The normal vector of the plane to be mirrored over * @default 2 */ this.factor = 2; if (crossSection !== undefined) { this.crossSection = crossSection; } if (factor !== undefined) { this.factor = factor; } } } Manifold.ScaleCrossSectionDto = ScaleCrossSectionDto; class TranslateXYCrossSectionDto { constructor(crossSection, x, y) { /** * The translation X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.x = 0; /** * The translation Y axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.y = 0; if (crossSection !== undefined) { this.crossSection = crossSection; } if (x !== undefined) { this.x = x; } if (y !== undefined) { this.y = y; } } } Manifold.TranslateXYCrossSectionDto = TranslateXYCrossSectionDto; class TransformCrossSectionDto { constructor(crossSection, transform) { if (crossSection !== undefined) { this.crossSection = crossSection; } if (transform !== undefined) { this.transform = transform; } } } Manifold.TransformCrossSectionDto = TransformCrossSectionDto; class CrossSectionWarpDto { constructor(crossSection, warpFunc) { if (crossSection !== undefined) { this.crossSection = crossSection; } if (warpFunc !== undefined) { this.warpFunc = warpFunc; } } } Manifold.CrossSectionWarpDto = CrossSectionWarpDto; class MirrorDto { constructor(manifold, normal) { /** * The normal vector of the plane to be mirrored over * @default [1,0,0] */ this.normal = [1, 0, 0]; if (manifold !== undefined) { this.manifold = manifold; } if (normal !== undefined) { this.normal = normal; } } } Manifold.MirrorDto = MirrorDto; class Scale3DDto { constructor(manifold, vector) { /** * The normal vector of the plane to be mirrored over * @default [2,2,2] */ this.vector = [2, 2, 2]; if (manifold !== undefined) { this.manifold = manifold; } if (vector !== undefined) { this.vector = vector; } } } Manifold.Scale3DDto = Scale3DDto; class TranslateDto { constructor(manifold, vector) { if (manifold !== undefined) { this.manifold = manifold; } if (vector !== undefined) { this.vector = vector; } } } Manifold.TranslateDto = TranslateDto; class TranslateByVectorsDto { constructor(manifold, vectors) { if (manifold !== undefined) { this.manifold = manifold; } if (vectors !== undefined) { this.vectors = vectors; } } } Manifold.TranslateByVectorsDto = TranslateByVectorsDto; class RotateDto { constructor(manifold, vector) { if (manifold !== undefined) { this.manifold = manifold; } if (vector !== undefined) { this.vector = vector; } } } Manifold.RotateDto = RotateDto; class RotateXYZDto { constructor(manifold, x, y, z) { /** * The rotation vector in eulers on X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.x = 0; /** * The rotation vector in eulers on Y axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.y = 0; /** * The rotation vector in eulers on Z axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.z = 0; if (manifold !== undefined) { this.manifold = manifold; } if (x !== undefined) { this.x = x; } if (y !== undefined) { this.y = y; } if (z !== undefined) { this.z = z; } } } Manifold.RotateXYZDto = RotateXYZDto; class ScaleDto { constructor(manifold, factor) { /** * The normal vector of the plane to be mirrored over * @default 2 */ this.factor = 2; if (manifold !== undefined) { this.manifold = manifold; } if (factor !== undefined) { this.factor = factor; } } } Manifold.ScaleDto = ScaleDto; class TranslateXYZDto { constructor(manifold, x, y, z) { /** * The translation X axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.x = 0; /** * The translation Y axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.y = 0; /** * The translation Z axis * @default 0 * @minimum -Infinity * @maximum Infinity * @step 1 */ this.z = 0; if (manifold !== undefined) { this.manifold = manifold; } if (x !== undefined) { this.x = x; } if (y !== undefined) { this.y = y; } if (z !== undefined) { this.z = z; } } } Manifold.TranslateXYZDto = TranslateXYZDto; class TransformDto { constructor(manifold, transform) { if (manifold !== undefined) { this.manifold = manifold; } if (transform !== undefined) { this.transform = transform; } } } Manifold.TransformDto = TransformDto; class TransformsDto { constructor(manifold, transforms) { if (manifold !== undefined) { this.manifold = manifold; } if (transforms !== undefined) { this.transforms = transforms; } } } Manifold.TransformsDto = TransformsDto; class ManifoldWarpDto { constructor(manifold, warpFunc) { if (manifold !== undefined) { this.manifold = manifold; } if (warpFunc !== undefined) { this.warpFunc = warpFunc; } } } Manifold.ManifoldWarpDto = ManifoldWarpDto; class TwoCrossSectionsDto { constructor(crossSection1, crossSection2) { if (crossSection1 !== undefined) { this.crossSection1 = crossSection1; } if (crossSection2 !== undefined) { this.crossSection2 = crossSection2; } } } Manifold.TwoCrossSectionsDto = TwoCrossSectionsDto; class TwoManifoldsDto { constructor(manifold1, manifold2) { if (manifold1 !== undefined) { this.manifold1 = manifold1; } if (manifold2 !== undefined) { this.manifold2 = manifold2; } } } Manifold.TwoManifoldsDto = TwoManifoldsDto; class SplitManifoldsDto { constructor(manifoldToSplit, manifoldCutter) { if (manifoldToSplit !== undefined) { this.manifoldToSplit = manifoldToSplit; } if (manifoldCutter !== undefined) { this.manifoldCutter = manifoldCutter; } } } Manifold.SplitManifoldsDto = SplitManifoldsDto; class TrimByPlaneDto { constructor(manifold, normal, originOffset) { /** * The normal vector of the plane to be mirrored over * @default [1,0,0] */ this.normal = [1, 0, 0]; /** * The offset from the origin * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ this.originOffset = 0; if (manifold !== undefined) { this.manifold = manifold; } if (normal !== undefined) { this.normal = normal; } if (originOffset !== undefined) { this.originOffset = originOffset; } } } Manifold.TrimByPlaneDto = TrimByPlaneDto; class SplitByPlaneDto { constructor(manifold, normal, originOffset) { /** * The normal vector of the plane to be mirrored over * @default [1,0,0] */ this.normal = [1, 0, 0]; /** * The offset from the origin * @default 0 * @minimum -Infinity * @maximum Infinity * @step 0.1 */ this.originOffset = 0; if (manifold !== undefined) { this.manifold = manifold; } if (normal !== undefined) { this.normal = normal; } if (originOffset !== undefined) { this.originOffset = originOffset; } } } Manifold.SplitByPlaneDto = SplitByPlaneDto; class SplitByPlaneOnOffsetsDto { constructor(manifold, normal, originOffsets) { /** * The normal vector of the plane to be mirrored over * @default [1,0,0] */ this.normal = [1, 0, 0]; /** * The offsets from the origin * @default [0] */ this.originOffsets = [0]; if (manifold !== undefined) { this.manifold = manifold; } if (normal !== undefined) { this.normal = normal; } if (originOffsets !== undefined) { this.originOffsets = originOffsets; } } } Manifold.SplitByPlaneOnOffsetsDto = SplitByPlaneOnOffsetsDto; class ManifoldsDto { constructor(manifolds) { if (manifolds !== undefined) { this.manifolds = manifolds; } } } Manifold.ManifoldsDto = ManifoldsDto; class ManifoldToMeshDto { constructor(manifold, normalIdx) { if (manifold !== undefined) { this.manifold = manifold; } if (normalIdx !== undefined) { this.normalIdx = normalIdx; } } } Manifold.ManifoldToMeshDto = ManifoldToMeshDto; class ManifoldsToMeshesDto { constructor(manifolds, normalIdx) { if (manifolds !== undefined) { this.manifolds = manifolds; } if (normalIdx !== undefined) { this.normalIdx = normalIdx; } } } Manifold.ManifoldsToMeshesDto = ManifoldsToMeshesDto; class DecomposeManifoldOrCrossSectionDto { constructor(manifoldOrCrossSection, normalIdx) { if (manifoldOrCrossSection !== undefined) { this.manifoldOrCrossSection = manifoldOrCrossSection; } if (normalIdx !== undefined) { this.normalIdx = normalIdx; } } } Manifold.DecomposeManifoldOrCrossSectionDto = DecomposeManifoldOrCrossSectionDto; class ManifoldOrCrossSectionDto { constructor(manifoldOrCrossSection) { if (manifoldOrCrossSection !== undefined) { this.manifoldOrCrossSection = manifoldOrCrossSection; } } } Manifold.ManifoldOrCrossSectionDto = ManifoldOrCrossSectionDto; class ManifoldsOrCrossSectionsDto { constructor(manifoldsOrCrossSections) { if (manifoldsOrCrossSections !== undefined) { this.manifoldsOrCrossSections = manifoldsOrCrossSections; } } } Manifold.ManifoldsOrCrossSectionsDto = ManifoldsOrCrossSectionsDto; class DecomposeManifoldsOrCrossSectionsDto { constructor(manifoldsOrCrossSections, normalIdx) { if (manifoldsOrCrossSections !== undefined) { this.manifoldsOrCrossSections = manifoldsOrCrossSections; } if (normalIdx !== undefined) { this.normalIdx = normalIdx; } } } Manifold.DecomposeManifoldsOrCrossSectionsDto = DecomposeManifoldsOrCrossSectionsDto; })(Manifold || (Manifold = {}));