Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x | /* eslint-disable @typescript-eslint/no-namespace */ import * as Inputs from "./inputs"; import { Base } from "./base-inputs"; // tslint:disable-next-line: no-namespace export namespace Draw { export type DrawOptions = DrawOcctShapeOptions | DrawBasicGeometryOptions; export type Entity = Base.Point3 | Base.Vector3 | Base.Line3 | Base.Polyline3 | Base.VerbCurve | Base.VerbSurface | Inputs.OCCT.TopoDSShapePointer | Inputs.Tag.TagDto | Base.Point3[] | Base.Vector3[] | Base.Line3[] | Base.Polyline3[] | Base.VerbCurve[] | Base.VerbSurface[] | Inputs.OCCT.TopoDSShapePointer[] | Inputs.Tag.TagDto[]; export class DrawAny<U> { constructor(entity?: Entity, options?: DrawOptions) { if (entity !== undefined) { this.entity = entity; } if (options !== undefined) { this.options = options; } } /** * Entity to be drawn - can be a single or multiple points, lines, polylines, verb curves, verb surfaces, jscad meshes, jscad polygons, jscad paths, occt shapes, tags, nodes * @default undefined */ entity: Entity; /** * Options that help you control how your drawn objects look like. This property is optional. In order to pick the right option you need to know which entity you are going to draw. For example if you draw points, lines, polylines or jscad meshes you can use basic geometry options, but if you want to draw OCCT shapes, use OCCT options. * @default undefined * @optional true */ options?: DrawOptions; /** * Group to indicate if geometry should be updated */ group?: U; } export class DrawOcctShapeOptions { /** * Provide options without default values */ constructor(faceOpacity?: number, edgeOpacity?: number, edgeColour?: Base.Color, faceMaterial?: Base.Material, faceColour?: Base.Color, edgeWidth?: number, drawEdges?: boolean, drawFaces?: boolean, drawVertices?: boolean, vertexColour?: Base.Color, vertexSize?: number, precision?: number, drawEdgeIndexes?: boolean, edgeIndexHeight?: number, edgeIndexColour?: Base.Color, drawFaceIndexes?: boolean, faceIndexHeight?: number, faceIndexColour?: Base.Color) { Iif (faceOpacity !== undefined) { this.faceOpacity = faceOpacity; } Iif (edgeOpacity !== undefined) { this.edgeOpacity = edgeOpacity; } Iif (edgeColour !== undefined) { this.edgeColour = edgeColour; } Iif (faceMaterial !== undefined) { this.faceMaterial = faceMaterial; } Iif (faceColour !== undefined) { this.faceColour = faceColour; } Iif (vertexColour !== undefined) { this.vertexColour = vertexColour; } Iif (vertexSize !== undefined) { this.vertexSize = vertexSize; } Iif (edgeWidth !== undefined) { this.edgeWidth = edgeWidth; } Iif (drawEdges !== undefined) { this.drawEdges = drawEdges; } Iif (drawFaces !== undefined) { this.drawFaces = drawFaces; } Iif (drawVertices !== undefined) { this.drawVertices = drawVertices; } Iif (precision !== undefined) { this.precision = precision; } Iif (drawEdgeIndexes !== undefined) { this.drawEdgeIndexes = drawEdgeIndexes; } Iif (edgeIndexHeight !== undefined) { this.edgeIndexHeight = edgeIndexHeight; } Iif (edgeIndexColour !== undefined) { this.edgeIndexColour = edgeIndexColour; } Iif (drawFaceIndexes !== undefined) { this.drawFaceIndexes = drawFaceIndexes; } Iif (faceIndexHeight !== undefined) { this.faceIndexHeight = faceIndexHeight; } Iif (faceIndexColour !== undefined) { this.faceIndexColour = faceIndexColour; } } /** * Face opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ faceOpacity = 1; /** * Edge opacity value between 0 and 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ edgeOpacity = 1; /** * Hex colour string for the edges * @default #ffffff */ edgeColour: Base.Color = "#ffffff"; /** * Hex colour string for face colour * @default #ff0000 */ faceColour: Base.Color = "#ff0000"; /** * Color of the vertices that will be drawn * @default #ff00ff */ vertexColour: Base.Color = "#ffaaff"; /** * Face material * @default undefined * @optional true */ faceMaterial?: Base.Material; /** * Edge width * @default 2 * @minimum 0 * @maximum Infinity * @step 0.1 */ edgeWidth = 2; /** * The size of a vertices that will be drawn * @default 0.03 * @minimum 0 * @maximum Infinity * @step 0.01 */ vertexSize = 0.03; /** * You can turn off drawing of edges via this property * @default true */ drawEdges = true; /** * You can turn off drawing of faces via this property * @default true */ drawFaces = true; /** * You can turn off drawing of vertexes via this property * @default false */ drawVertices = false; /** * Precision of the mesh that will be generated for the shape, lower number will mean more triangles * @default 0.01 * @minimum 0 * @maximum Infinity * @step 0.01 */ precision = 0.01; /** * Draw index of edges in space * @default false */ drawEdgeIndexes = false; /** * Indicates the edge index height if they are drawn * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ edgeIndexHeight = 0.06; /** * Edge index colour if the edges are drawn * @default #ff00ff */ edgeIndexColour: Base.Color = "#ff00ff"; /** * Draw indexes of faces in space * @default false */ drawFaceIndexes = false; /** * Indicates the edge index height if they are drawn * @default 0.06 * @minimum 0 * @maximum Infinity * @step 0.01 */ faceIndexHeight = 0.06; /** * Edge index colour if the edges are drawn * @default #0000ff */ faceIndexColour: Base.Color = "#0000ff"; } /** * Draw options for basic geometry types like points, lines, polylines, surfaces and jscad meshes */ export class DrawBasicGeometryOptions { constructor(colours?: string | string[], size?: number, opacity?: number, updatable?: boolean, hidden?: boolean) { Iif (colours !== undefined) { this.colours = colours; } Iif (size !== undefined) { this.size = size; } Iif (opacity !== undefined) { this.opacity = opacity; } Iif (updatable !== undefined) { this.updatable = updatable; } Iif (hidden !== undefined) { this.hidden = hidden; } } /** * Basic geometry colours to use for lines, points, polylines, surfaces, jscad meshes. * @default #ff0000 */ colours: string | string[] = "#ff0000"; /** * Size affect how big the drawn points are and how wide lines are. * @default 0.1 * @minimum 0 * @maximum Infinity * @step 0.1 */ size = 0.1; /** * Opacity of the point 0 to 1 * @default 1 * @minimum 0 * @maximum 1 * @step 0.1 */ opacity = 1; /** * If geometry needs to be updated later * @default false */ updatable = false; /** * Hidden * @default false */ hidden = false; } export enum drawingTypes { point, points, line, lines, node, nodes, polyline, polylines, verbCurve, verbCurves, verbSurface, verbSurfaces, jscadMesh, jscadMeshes, occt, occtShapes, tag, tags, } } |