@tableslayer/ui 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/components/MarkerTooltip/MarkerTooltip.svelte +9 -1
  2. package/dist/components/MarkerTooltip/MarkerTooltip.svelte.d.ts +13 -16
  3. package/dist/components/index.d.ts +0 -5
  4. package/dist/components/index.js +0 -5
  5. package/package.json +1 -8
  6. package/dist/components/DrawingSliders/DrawingSliders.svelte +0 -379
  7. package/dist/components/DrawingSliders/DrawingSliders.svelte.d.ts +0 -16
  8. package/dist/components/DrawingSliders/index.d.ts +0 -1
  9. package/dist/components/DrawingSliders/index.js +0 -1
  10. package/dist/components/MyCounterButton.svelte +0 -11
  11. package/dist/components/MyCounterButton.svelte.d.ts +0 -3
  12. package/dist/components/PropsTable/PropsTable.svelte +0 -107
  13. package/dist/components/PropsTable/PropsTable.svelte.d.ts +0 -26
  14. package/dist/components/RadialMenu/EffectPreview.svelte +0 -36
  15. package/dist/components/RadialMenu/EffectPreview.svelte.d.ts +0 -9
  16. package/dist/components/RadialMenu/EffectPreviewScene.svelte +0 -194
  17. package/dist/components/RadialMenu/EffectPreviewScene.svelte.d.ts +0 -8
  18. package/dist/components/RadialMenu/RadialMenu.svelte +0 -503
  19. package/dist/components/RadialMenu/RadialMenu.svelte.d.ts +0 -4
  20. package/dist/components/RadialMenu/RadialMenuItem.svelte +0 -176
  21. package/dist/components/RadialMenu/RadialMenuItem.svelte.d.ts +0 -11
  22. package/dist/components/RadialMenu/index.d.ts +0 -2
  23. package/dist/components/RadialMenu/index.js +0 -2
  24. package/dist/components/RadialMenu/types.d.ts +0 -35
  25. package/dist/components/RadialMenu/types.js +0 -1
  26. package/dist/components/Stage/components/AnnotationLayer/AnnotationLayer.svelte +0 -445
  27. package/dist/components/Stage/components/AnnotationLayer/AnnotationLayer.svelte.d.ts +0 -19
  28. package/dist/components/Stage/components/AnnotationLayer/AnnotationMaterial.svelte +0 -167
  29. package/dist/components/Stage/components/AnnotationLayer/AnnotationMaterial.svelte.d.ts +0 -20
  30. package/dist/components/Stage/components/AnnotationLayer/types.d.ts +0 -121
  31. package/dist/components/Stage/components/AnnotationLayer/types.js +0 -71
  32. package/dist/components/Stage/components/CursorLayer/CursorLayer.svelte +0 -148
  33. package/dist/components/Stage/components/CursorLayer/CursorLayer.svelte.d.ts +0 -7
  34. package/dist/components/Stage/components/CursorLayer/cursor.svg +0 -26
  35. package/dist/components/Stage/components/CursorLayer/index.d.ts +0 -2
  36. package/dist/components/Stage/components/CursorLayer/index.js +0 -1
  37. package/dist/components/Stage/components/CursorLayer/types.d.ts +0 -28
  38. package/dist/components/Stage/components/CursorLayer/types.js +0 -1
  39. package/dist/components/Stage/components/DrawingLayer/DrawingMaterial.svelte +0 -364
  40. package/dist/components/Stage/components/DrawingLayer/DrawingMaterial.svelte.d.ts +0 -24
  41. package/dist/components/Stage/components/DrawingLayer/types.d.ts +0 -56
  42. package/dist/components/Stage/components/DrawingLayer/types.js +0 -23
  43. package/dist/components/Stage/components/EdgeOverlayLayer/EdgeOverlayLayer.svelte +0 -72
  44. package/dist/components/Stage/components/EdgeOverlayLayer/EdgeOverlayLayer.svelte.d.ts +0 -11
  45. package/dist/components/Stage/components/EdgeOverlayLayer/types.d.ts +0 -29
  46. package/dist/components/Stage/components/EdgeOverlayLayer/types.js +0 -1
  47. package/dist/components/Stage/components/FogLayer/FogLayer.svelte +0 -75
  48. package/dist/components/Stage/components/FogLayer/FogLayer.svelte.d.ts +0 -11
  49. package/dist/components/Stage/components/FogLayer/types.d.ts +0 -42
  50. package/dist/components/Stage/components/FogLayer/types.js +0 -1
  51. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarLayer.svelte +0 -249
  52. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarLayer.svelte.d.ts +0 -19
  53. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarMaterial.svelte +0 -200
  54. package/dist/components/Stage/components/FogOfWarLayer/FogOfWarMaterial.svelte.d.ts +0 -18
  55. package/dist/components/Stage/components/FogOfWarLayer/types.d.ts +0 -143
  56. package/dist/components/Stage/components/FogOfWarLayer/types.js +0 -1
  57. package/dist/components/Stage/components/GridLayer/GridLayer.svelte +0 -20
  58. package/dist/components/Stage/components/GridLayer/GridLayer.svelte.d.ts +0 -12
  59. package/dist/components/Stage/components/GridLayer/GridMaterial.svelte +0 -69
  60. package/dist/components/Stage/components/GridLayer/GridMaterial.svelte.d.ts +0 -10
  61. package/dist/components/Stage/components/GridLayer/types.d.ts +0 -65
  62. package/dist/components/Stage/components/GridLayer/types.js +0 -10
  63. package/dist/components/Stage/components/LayerInput/LayerInput.svelte +0 -300
  64. package/dist/components/Stage/components/LayerInput/LayerInput.svelte.d.ts +0 -20
  65. package/dist/components/Stage/components/MapLayer/MapLayer.svelte +0 -196
  66. package/dist/components/Stage/components/MapLayer/MapLayer.svelte.d.ts +0 -24
  67. package/dist/components/Stage/components/MapLayer/dataSources/GifDataSource.d.ts +0 -93
  68. package/dist/components/Stage/components/MapLayer/dataSources/GifDataSource.js +0 -229
  69. package/dist/components/Stage/components/MapLayer/dataSources/IMapDataSource.d.ts +0 -51
  70. package/dist/components/Stage/components/MapLayer/dataSources/IMapDataSource.js +0 -1
  71. package/dist/components/Stage/components/MapLayer/dataSources/ImageDataSource.d.ts +0 -49
  72. package/dist/components/Stage/components/MapLayer/dataSources/ImageDataSource.js +0 -87
  73. package/dist/components/Stage/components/MapLayer/dataSources/VideoDataSource.d.ts +0 -52
  74. package/dist/components/Stage/components/MapLayer/dataSources/VideoDataSource.js +0 -141
  75. package/dist/components/Stage/components/MapLayer/dataSources/dataSourceFactory.d.ts +0 -21
  76. package/dist/components/Stage/components/MapLayer/dataSources/dataSourceFactory.js +0 -44
  77. package/dist/components/Stage/components/MapLayer/dataSources/index.d.ts +0 -15
  78. package/dist/components/Stage/components/MapLayer/dataSources/index.js +0 -14
  79. package/dist/components/Stage/components/MapLayer/types.d.ts +0 -54
  80. package/dist/components/Stage/components/MapLayer/types.js +0 -9
  81. package/dist/components/Stage/components/MarkerLayer/MarkerLayer.svelte +0 -398
  82. package/dist/components/Stage/components/MarkerLayer/MarkerLayer.svelte.d.ts +0 -24
  83. package/dist/components/Stage/components/MarkerLayer/MarkerToken.svelte +0 -262
  84. package/dist/components/Stage/components/MarkerLayer/MarkerToken.svelte.d.ts +0 -27
  85. package/dist/components/Stage/components/MarkerLayer/types.d.ts +0 -109
  86. package/dist/components/Stage/components/MarkerLayer/types.js +0 -21
  87. package/dist/components/Stage/components/MeasurementLayer/MeasurementLayer.svelte +0 -364
  88. package/dist/components/Stage/components/MeasurementLayer/MeasurementLayer.svelte.d.ts +0 -49
  89. package/dist/components/Stage/components/MeasurementLayer/MeasurementManager.svelte +0 -473
  90. package/dist/components/Stage/components/MeasurementLayer/MeasurementManager.svelte.d.ts +0 -24
  91. package/dist/components/Stage/components/MeasurementLayer/measurements/BaseMeasurement.d.ts +0 -150
  92. package/dist/components/Stage/components/MeasurementLayer/measurements/BaseMeasurement.js +0 -274
  93. package/dist/components/Stage/components/MeasurementLayer/measurements/BeamMeasurement.d.ts +0 -10
  94. package/dist/components/Stage/components/MeasurementLayer/measurements/BeamMeasurement.js +0 -58
  95. package/dist/components/Stage/components/MeasurementLayer/measurements/CircleMeasurement.d.ts +0 -9
  96. package/dist/components/Stage/components/MeasurementLayer/measurements/CircleMeasurement.js +0 -66
  97. package/dist/components/Stage/components/MeasurementLayer/measurements/ConeMeasurement.d.ts +0 -10
  98. package/dist/components/Stage/components/MeasurementLayer/measurements/ConeMeasurement.js +0 -103
  99. package/dist/components/Stage/components/MeasurementLayer/measurements/LineMeasurement.d.ts +0 -9
  100. package/dist/components/Stage/components/MeasurementLayer/measurements/LineMeasurement.js +0 -75
  101. package/dist/components/Stage/components/MeasurementLayer/measurements/RectangleMeasurement.d.ts +0 -9
  102. package/dist/components/Stage/components/MeasurementLayer/measurements/RectangleMeasurement.js +0 -73
  103. package/dist/components/Stage/components/MeasurementLayer/measurements/index.d.ts +0 -2
  104. package/dist/components/Stage/components/MeasurementLayer/measurements/index.js +0 -7
  105. package/dist/components/Stage/components/MeasurementLayer/types.d.ts +0 -76
  106. package/dist/components/Stage/components/MeasurementLayer/types.js +0 -9
  107. package/dist/components/Stage/components/MeasurementLayer/utils/canvasDrawing.d.ts +0 -83
  108. package/dist/components/Stage/components/MeasurementLayer/utils/canvasDrawing.js +0 -267
  109. package/dist/components/Stage/components/MeasurementLayer/utils/distanceCalculations.d.ts +0 -74
  110. package/dist/components/Stage/components/MeasurementLayer/utils/distanceCalculations.js +0 -130
  111. package/dist/components/Stage/components/ParticleSystem/ParticleSystem.svelte +0 -220
  112. package/dist/components/Stage/components/ParticleSystem/ParticleSystem.svelte.d.ts +0 -9
  113. package/dist/components/Stage/components/ParticleSystem/particles/atlases/ash.png +0 -0
  114. package/dist/components/Stage/components/ParticleSystem/particles/atlases/leaves.png +0 -0
  115. package/dist/components/Stage/components/ParticleSystem/particles/atlases/rain.png +0 -0
  116. package/dist/components/Stage/components/ParticleSystem/particles/atlases/snow.png +0 -0
  117. package/dist/components/Stage/components/ParticleSystem/rng.d.ts +0 -7
  118. package/dist/components/Stage/components/ParticleSystem/rng.js +0 -20
  119. package/dist/components/Stage/components/ParticleSystem/types.d.ts +0 -88
  120. package/dist/components/Stage/components/ParticleSystem/types.js +0 -37
  121. package/dist/components/Stage/components/PerformanceDebugger/PerformanceDebugger.svelte +0 -144
  122. package/dist/components/Stage/components/PerformanceDebugger/PerformanceDebugger.svelte.d.ts +0 -19
  123. package/dist/components/Stage/components/PerformanceDebugger/index.d.ts +0 -1
  124. package/dist/components/Stage/components/PerformanceDebugger/index.js +0 -1
  125. package/dist/components/Stage/components/PerformanceOverlay/PerformanceOverlay.svelte +0 -208
  126. package/dist/components/Stage/components/PerformanceOverlay/PerformanceOverlay.svelte.d.ts +0 -7
  127. package/dist/components/Stage/components/PerformanceOverlay/index.d.ts +0 -1
  128. package/dist/components/Stage/components/PerformanceOverlay/index.js +0 -1
  129. package/dist/components/Stage/components/PointerInputManager/PointerInputManager.svelte +0 -201
  130. package/dist/components/Stage/components/PointerInputManager/PointerInputManager.svelte.d.ts +0 -17
  131. package/dist/components/Stage/components/Scene/Scene.svelte +0 -651
  132. package/dist/components/Stage/components/Scene/Scene.svelte.d.ts +0 -88
  133. package/dist/components/Stage/components/Scene/luts.d.ts +0 -7
  134. package/dist/components/Stage/components/Scene/luts.js +0 -33
  135. package/dist/components/Stage/components/Scene/types.d.ts +0 -207
  136. package/dist/components/Stage/components/Scene/types.js +0 -35
  137. package/dist/components/Stage/components/Stage/Stage.svelte +0 -332
  138. package/dist/components/Stage/components/Stage/Stage.svelte.d.ts +0 -86
  139. package/dist/components/Stage/components/Stage/types.d.ts +0 -163
  140. package/dist/components/Stage/components/Stage/types.js +0 -5
  141. package/dist/components/Stage/components/WeatherLayer/WeatherLayer.svelte +0 -135
  142. package/dist/components/Stage/components/WeatherLayer/WeatherLayer.svelte.d.ts +0 -13
  143. package/dist/components/Stage/components/WeatherLayer/presets/AshPreset.d.ts +0 -3
  144. package/dist/components/Stage/components/WeatherLayer/presets/AshPreset.js +0 -69
  145. package/dist/components/Stage/components/WeatherLayer/presets/LeavesPreset.d.ts +0 -3
  146. package/dist/components/Stage/components/WeatherLayer/presets/LeavesPreset.js +0 -68
  147. package/dist/components/Stage/components/WeatherLayer/presets/RainPreset.d.ts +0 -3
  148. package/dist/components/Stage/components/WeatherLayer/presets/RainPreset.js +0 -67
  149. package/dist/components/Stage/components/WeatherLayer/presets/SnowPreset.d.ts +0 -3
  150. package/dist/components/Stage/components/WeatherLayer/presets/SnowPreset.js +0 -68
  151. package/dist/components/Stage/components/WeatherLayer/presets/index.d.ts +0 -5
  152. package/dist/components/Stage/components/WeatherLayer/presets/index.js +0 -5
  153. package/dist/components/Stage/components/WeatherLayer/types.d.ts +0 -31
  154. package/dist/components/Stage/components/WeatherLayer/types.js +0 -9
  155. package/dist/components/Stage/helpers/clippingPlaneStore.svelte.d.ts +0 -7
  156. package/dist/components/Stage/helpers/clippingPlaneStore.svelte.js +0 -23
  157. package/dist/components/Stage/helpers/debugState.svelte.d.ts +0 -10
  158. package/dist/components/Stage/helpers/debugState.svelte.js +0 -13
  159. package/dist/components/Stage/helpers/grid.d.ts +0 -72
  160. package/dist/components/Stage/helpers/grid.js +0 -444
  161. package/dist/components/Stage/helpers/lazyBrush.d.ts +0 -63
  162. package/dist/components/Stage/helpers/lazyBrush.js +0 -137
  163. package/dist/components/Stage/helpers/performanceMetrics.svelte.d.ts +0 -62
  164. package/dist/components/Stage/helpers/performanceMetrics.svelte.js +0 -165
  165. package/dist/components/Stage/helpers/utils.d.ts +0 -3
  166. package/dist/components/Stage/helpers/utils.js +0 -18
  167. package/dist/components/Stage/index.d.ts +0 -21
  168. package/dist/components/Stage/index.js +0 -21
  169. package/dist/components/Stage/shaders/AnnotationEffects.frag +0 -1070
  170. package/dist/components/Stage/shaders/Annotations.frag +0 -29
  171. package/dist/components/Stage/shaders/Drawing.frag +0 -83
  172. package/dist/components/Stage/shaders/Drawing.vert +0 -5
  173. package/dist/components/Stage/shaders/Fog.frag +0 -147
  174. package/dist/components/Stage/shaders/FractalNoise.frag +0 -96
  175. package/dist/components/Stage/shaders/GridShader.frag +0 -174
  176. package/dist/components/Stage/shaders/Overlay.frag +0 -23
  177. package/dist/components/Stage/shaders/Overlay.vert +0 -0
  178. package/dist/components/Stage/shaders/Particles.frag +0 -27
  179. package/dist/components/Stage/shaders/Particles.vert +0 -51
  180. package/dist/components/Stage/shaders/ToolOutline.frag +0 -59
  181. package/dist/components/Stage/shaders/default.vert +0 -8
  182. package/dist/components/Stage/types.d.ts +0 -4
  183. package/dist/components/Stage/types.js +0 -1
@@ -1,274 +0,0 @@
1
- import * as THREE from 'three';
2
- import { hexDistance, pixelToHex } from '../../../helpers/grid';
3
- import { GridType } from '../../GridLayer/types';
4
- import { SceneLayer, SceneLayerOrder } from '../../Scene/types';
5
- import { MeasurementType } from '../types';
6
- import { createTextCanvas } from '../utils/canvasDrawing';
7
- import { calculateLineDistance } from '../utils/distanceCalculations';
8
- // =============================================================================
9
- // MEASUREMENT CONSTANTS
10
- // =============================================================================
11
- /** Distance in pixels to offset text labels from measurement end points */
12
- const TEXT_OFFSET_DISTANCE = 150;
13
- /** Divisor for calculating font size based on display resolution */
14
- const FONT_SIZE_DIVISOR = 15;
15
- /** Decimal places for distance display */
16
- const DISTANCE_DECIMAL_PLACES = 1;
17
- /**
18
- * Abstract base class providing common functionality for all measurement types.
19
- * Handles shared behavior like distance calculation, text rendering, resource management,
20
- * and coordinate transformations while allowing subclasses to implement specific shapes.
21
- */
22
- export class BaseMeasurement {
23
- /**
24
- * Creates a new measurement instance with the specified properties.
25
- * Initializes all measurement parameters and sets up the coordinate system.
26
- *
27
- * @param {MeasurementType} type - The specific type of measurement being created
28
- * @param {THREE.Vector2} startPoint - Initial starting point in world coordinates
29
- * @param {MeasurementLayerProps} measurementProps - Configuration properties for the measurement
30
- * @param {DisplayProps} displayProps - Display settings including resolution and dimensions
31
- * @param {GridLayerProps} gridProps - Grid configuration for snapping and units
32
- */
33
- constructor(type, startPoint, measurementProps, displayProps, gridProps) {
34
- /** Scene rotation in degrees for text alignment */
35
- this.sceneRotation = 0;
36
- /** Flag indicating whether this measurement has been disposed */
37
- this.isDisposed = false;
38
- this.id = crypto.randomUUID();
39
- this.type = type;
40
- this.startPoint = startPoint.clone();
41
- this.endPoint = startPoint.clone();
42
- this.createdAt = Date.now();
43
- this.color = measurementProps.color;
44
- this.opacity = measurementProps.opacity;
45
- this.thickness = measurementProps.thickness;
46
- this.markerSize = measurementProps.markerSize;
47
- this.outlineThickness = measurementProps.outlineThickness;
48
- this.outlineColor = measurementProps.outlineColor;
49
- this.showDistance = measurementProps.showDistance;
50
- this.snapToGrid = measurementProps.snapToGrid;
51
- this.enableDMG252 = measurementProps.enableDMG252;
52
- this.displayProps = displayProps;
53
- this.gridProps = gridProps;
54
- this.object = new THREE.Group();
55
- this.object.userData.measurementId = this.id;
56
- // Create meshes and materials once, only update the texture when the measurement is updated
57
- const shapeMaterial = new THREE.MeshBasicMaterial({
58
- map: null,
59
- transparent: true,
60
- opacity: this.opacity,
61
- side: THREE.DoubleSide,
62
- depthWrite: false,
63
- depthTest: false,
64
- toneMapped: false // Prevent tone mapping from making white appear gray
65
- });
66
- this.shapeMesh = new THREE.Mesh(undefined, shapeMaterial);
67
- this.shapeMesh.layers.set(SceneLayer.Overlay);
68
- this.shapeMesh.renderOrder = SceneLayerOrder.Measurement;
69
- // Create an empty text mesh that will be updated when measurement has actual distance
70
- const emptyCanvas = document.createElement('canvas');
71
- emptyCanvas.width = 1;
72
- emptyCanvas.height = 1;
73
- const emptyTexture = new THREE.CanvasTexture(emptyCanvas);
74
- const textMaterial = new THREE.MeshBasicMaterial({
75
- map: emptyTexture,
76
- transparent: true,
77
- opacity: this.opacity,
78
- depthWrite: false,
79
- depthTest: false,
80
- toneMapped: false // Prevent tone mapping from making white appear gray
81
- });
82
- this.textMesh = new THREE.Mesh(new THREE.PlaneGeometry(1, 1), textMaterial);
83
- this.textMesh.layers.set(SceneLayer.Overlay);
84
- this.textMesh.renderOrder = SceneLayerOrder.Measurement;
85
- this.textMesh.visible = false; // Start invisible until we have actual content
86
- this.object.add(this.shapeMesh);
87
- this.object.add(this.textMesh);
88
- }
89
- /**
90
- * Updates the measurement with a new end point and recalculates all derived values.
91
- * Recreates the shape and text objects to reflect the new measurement geometry.
92
- * This method is called continuously during measurement creation as the user moves the mouse.
93
- *
94
- * @param {THREE.Vector2} endPoint - The new end point coordinates in world space
95
- * @param {number} sceneRotation - Optional scene rotation in degrees
96
- * @returns {void}
97
- */
98
- update(endPoint, sceneRotation) {
99
- if (this.isDisposed)
100
- return;
101
- this.endPoint = endPoint.clone();
102
- if (sceneRotation !== undefined) {
103
- this.sceneRotation = sceneRotation;
104
- }
105
- this.renderShape();
106
- this.renderText();
107
- }
108
- /**
109
- * Renders the distance text label for this measurement with standard positioning logic.
110
- * Positions text 150 pixels away from the end point in the direction of the measurement.
111
- * All measurement types share this text positioning and styling approach.
112
- * Returns an empty group if distance display is disabled.
113
- *
114
- * @returns {void}
115
- */
116
- renderText() {
117
- // Calculate direction from start to end point and normalize
118
- const direction = this.endPoint.clone().sub(this.startPoint).normalize();
119
- // Initial text position at standard offset distance from the end point
120
- let textPosition = this.endPoint.clone().add(direction.multiplyScalar(TEXT_OFFSET_DISTANCE));
121
- // Edge detection and adjustment
122
- const padding = 150; // Padding from edges to prevent clipping
123
- const halfWidth = this.displayProps.resolution.x / 2;
124
- const halfHeight = this.displayProps.resolution.y / 2;
125
- // Check and adjust for edge clipping
126
- if (textPosition.x > halfWidth - padding) {
127
- textPosition.x = halfWidth - padding;
128
- }
129
- else if (textPosition.x < -halfWidth + padding) {
130
- textPosition.x = -halfWidth + padding;
131
- }
132
- if (textPosition.y > halfHeight - padding) {
133
- textPosition.y = halfHeight - padding;
134
- }
135
- else if (textPosition.y < -halfHeight + padding) {
136
- textPosition.y = -halfHeight + padding;
137
- }
138
- // For hex grids with snapping, we want to show hex count instead of distance
139
- const isHexGrid = this.gridProps.gridType === GridType.Hex;
140
- const showHexCount = isHexGrid && this.snapToGrid;
141
- let distance;
142
- let displayText;
143
- let displayUnits;
144
- if (showHexCount) {
145
- // Calculate hex count directly
146
- const pixelsPerInchX = this.displayProps.resolution.x / this.displayProps.size.x;
147
- const hexSizePixels = this.gridProps.spacing * pixelsPerInchX;
148
- const startHex = pixelToHex(this.startPoint, hexSizePixels);
149
- const endHex = pixelToHex(this.endPoint, hexSizePixels);
150
- distance = hexDistance(startHex, endHex);
151
- // Format as integer hex count
152
- displayText = Math.round(distance).toString();
153
- displayUnits = distance === 1 ? 'hex' : 'hexes';
154
- }
155
- else {
156
- // Standard distance calculation
157
- distance = calculateLineDistance(this.startPoint, this.endPoint, this.gridProps.spacing, this.displayProps.size, this.displayProps.resolution, this.gridProps.gridType, this.snapToGrid, this.enableDMG252, this.gridProps.worldGridSize || 5, this.gridProps.worldGridUnits || 'FT');
158
- // Format number to only show decimals if needed
159
- displayText = distance % 1 === 0 ? distance.toString() : distance.toFixed(DISTANCE_DECIMAL_PLACES);
160
- displayUnits = this.gridProps.worldGridUnits || 'FT';
161
- }
162
- // Don't render text for zero distance
163
- if (distance === 0) {
164
- this.textMesh.visible = false;
165
- return;
166
- }
167
- // Show the text mesh since we have content
168
- this.textMesh.visible = true;
169
- const fontSize = this.displayProps.resolution.y / FONT_SIZE_DIVISOR;
170
- const textCanvas = createTextCanvas(displayText, fontSize, this.color, this.outlineColor, this.outlineThickness, displayUnits);
171
- // Create texture from canvas
172
- const texture = new THREE.CanvasTexture(textCanvas);
173
- texture.needsUpdate = true;
174
- // Update the text mesh geometry to match canvas size
175
- if (this.textMesh.geometry) {
176
- this.textMesh.geometry.dispose();
177
- }
178
- this.textMesh.geometry = new THREE.PlaneGeometry(textCanvas.width, textCanvas.height);
179
- if (this.textMesh.material instanceof THREE.MeshBasicMaterial) {
180
- // Dispose the old texture before assigning new one to prevent memory leak
181
- if (this.textMesh.material.map) {
182
- this.textMesh.material.map.dispose();
183
- }
184
- this.textMesh.material.map = texture;
185
- this.textMesh.material.map.needsUpdate = true;
186
- }
187
- this.textMesh.position.set(textPosition.x, textPosition.y, 0);
188
- // Apply counter-rotation to keep text aligned to browser bottom
189
- // Similar to how markers handle rotation
190
- const normalizedRotation = ((this.sceneRotation % 360) + 360) % 360;
191
- const needsFlip = (normalizedRotation > 85 && normalizedRotation < 95) || (normalizedRotation > 265 && normalizedRotation < 275);
192
- const counterRotation = needsFlip
193
- ? -((this.sceneRotation + 180) * Math.PI) / 180
194
- : -(this.sceneRotation * Math.PI) / 180;
195
- this.textMesh.rotation.z = counterRotation;
196
- }
197
- /**
198
- * Creates a Three.js mesh displaying text with consistent styling across all measurements.
199
- * Generates a canvas-based texture with the specified text and applies standard material settings
200
- * for proper transparency, layering, and visual appearance.
201
- *
202
- * @param {string} text - The text content to display
203
- * @param {THREE.Vector2} position - World coordinates where the text should be positioned
204
- * @returns {THREE.Mesh} A Three.js mesh containing the rendered text
205
- */
206
- createTextMesh(text, position) {
207
- const fontSize = this.displayProps.resolution.y / FONT_SIZE_DIVISOR;
208
- const canvas = createTextCanvas(text, fontSize, this.color, this.outlineColor, this.outlineThickness);
209
- // Create texture from canvas
210
- const texture = new THREE.CanvasTexture(canvas);
211
- texture.needsUpdate = true;
212
- // Create plane geometry for text with world dimensions
213
- const geometry = new THREE.PlaneGeometry(canvas.width, canvas.height);
214
- const material = new THREE.MeshBasicMaterial({
215
- map: texture,
216
- transparent: true,
217
- opacity: this.opacity,
218
- toneMapped: false // Prevent tone mapping from making white appear gray
219
- });
220
- const textMesh = new THREE.Mesh(geometry, material);
221
- textMesh.layers.set(SceneLayer.Overlay);
222
- textMesh.renderOrder = SceneLayerOrder.Measurement;
223
- textMesh.position.set(position.x, position.y, 0);
224
- return textMesh;
225
- }
226
- /**
227
- * Updates the shape mesh with a new geometry and texture.
228
- * @param {THREE.PlaneGeometry} geometry - The new geometry to use
229
- * @param {THREE.CanvasTexture} texture - The new texture to use
230
- * @returns {void}
231
- */
232
- updateShapeMesh(geometry, texture) {
233
- var _a;
234
- (_a = this.shapeMesh.geometry) === null || _a === void 0 ? void 0 : _a.dispose();
235
- this.shapeMesh.geometry = geometry;
236
- if (this.shapeMesh.material instanceof THREE.MeshBasicMaterial) {
237
- // Dispose the old texture before assigning new one to prevent memory leak
238
- if (this.shapeMesh.material.map) {
239
- this.shapeMesh.material.map.dispose();
240
- }
241
- this.shapeMesh.material.map = texture;
242
- this.shapeMesh.material.map.needsUpdate = true;
243
- }
244
- }
245
- /**
246
- * Completely destroys this measurement instance and cleans up all associated resources.
247
- * Removes objects from the scene, disposes of Three.js resources, and marks the measurement as disposed.
248
- * Should be called when the measurement is no longer needed to prevent memory leaks.
249
- * @returns {void}
250
- */
251
- dispose() {
252
- var _a, _b, _c, _d;
253
- this.isDisposed = true;
254
- this.shapeMesh.removeFromParent();
255
- if (this.shapeMesh instanceof THREE.Mesh) {
256
- (_a = this.shapeMesh.geometry) === null || _a === void 0 ? void 0 : _a.dispose();
257
- // Dispose texture before disposing material
258
- if (this.shapeMesh.material instanceof THREE.MeshBasicMaterial && this.shapeMesh.material.map) {
259
- this.shapeMesh.material.map.dispose();
260
- }
261
- (_b = this.shapeMesh.material) === null || _b === void 0 ? void 0 : _b.dispose();
262
- }
263
- this.textMesh.removeFromParent();
264
- if (this.textMesh instanceof THREE.Mesh) {
265
- (_c = this.textMesh.geometry) === null || _c === void 0 ? void 0 : _c.dispose();
266
- // Dispose texture before disposing material
267
- if (this.textMesh.material instanceof THREE.MeshBasicMaterial && this.textMesh.material.map) {
268
- this.textMesh.material.map.dispose();
269
- }
270
- (_d = this.textMesh.material) === null || _d === void 0 ? void 0 : _d.dispose();
271
- }
272
- this.object.removeFromParent();
273
- }
274
- }
@@ -1,10 +0,0 @@
1
- import * as THREE from 'three';
2
- import type { DisplayProps } from '../../Stage/types';
3
- import type { GridLayerProps } from '../../GridLayer/types';
4
- import { type MeasurementLayerProps } from '../types';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export declare class BeamMeasurement extends BaseMeasurement {
7
- private beamWidth;
8
- constructor(startPoint: THREE.Vector2, measurementProps: MeasurementLayerProps, displayProps: DisplayProps, gridProps: GridLayerProps);
9
- renderShape(): void;
10
- }
@@ -1,58 +0,0 @@
1
- // prettier-ignore
2
- import * as THREE from 'three';
3
- import { MeasurementType } from '../types';
4
- import { drawCircle, drawRectangle } from '../utils/canvasDrawing';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export class BeamMeasurement extends BaseMeasurement {
7
- constructor(startPoint, measurementProps, displayProps, gridProps) {
8
- super(MeasurementType.Beam, startPoint, measurementProps, displayProps, gridProps);
9
- this.beamWidth = measurementProps.beamWidth;
10
- }
11
- renderShape() {
12
- // Calculate beam parameters
13
- const direction = this.endPoint.clone().sub(this.startPoint);
14
- const length = direction.length();
15
- const angle = Math.atan2(direction.y, direction.x);
16
- // Convert beam width from world units to pixels
17
- const pixelsPerInch = this.displayProps.resolution.x / this.displayProps.size.x;
18
- const beamWidthInches = (this.beamWidth * this.gridProps.spacing) / this.gridProps.worldGridSize;
19
- const beamWidthPixels = beamWidthInches * pixelsPerInch;
20
- // Create canvas for the beam
21
- const canvas = document.createElement('canvas');
22
- const context = canvas.getContext('2d', { colorSpace: 'srgb' });
23
- // Calculate canvas size - accommodate beam dimensions plus padding
24
- const padding = Math.max(this.markerSize + this.outlineThickness + beamWidthPixels, 40);
25
- const canvasWidth = length + padding * 2;
26
- const canvasHeight = beamWidthPixels + padding * 2;
27
- canvas.width = Math.max(canvasWidth, 100);
28
- canvas.height = Math.max(canvasHeight, 100);
29
- // Clear canvas
30
- context.clearRect(0, 0, canvas.width, canvas.height);
31
- // Save context and apply rotation
32
- context.save();
33
- context.translate(canvas.width / 2, canvas.height / 2);
34
- // Calculate rectangle dimensions centered on canvas
35
- const rectX = -length / 2;
36
- const rectY = -beamWidthPixels / 2;
37
- const rectWidth = length;
38
- const rectHeight = beamWidthPixels;
39
- // Draw beam rectangle using utility function
40
- if (rectWidth > 0 && rectHeight > 0) {
41
- drawRectangle(context, rectX, rectY, rectWidth, rectHeight, this.color, this.thickness, this.color, 0.2, this.outlineThickness > 0 ? this.outlineColor : undefined, this.outlineThickness > 0 ? this.outlineThickness : undefined);
42
- }
43
- // Draw start point circle
44
- drawCircle(context, rectX, 0, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
45
- // Draw end point circle
46
- drawCircle(context, rectX + rectWidth, 0, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
47
- // Restore context
48
- context.restore();
49
- const texture = new THREE.CanvasTexture(canvas);
50
- texture.needsUpdate = true;
51
- this.updateShapeMesh(new THREE.PlaneGeometry(canvas.width, canvas.height), texture);
52
- // Position the beam at the center point between start and end
53
- const centerX = (this.startPoint.x + this.endPoint.x) / 2;
54
- const centerY = (this.startPoint.y + this.endPoint.y) / 2;
55
- this.shapeMesh.position.set(centerX, centerY, 0);
56
- this.shapeMesh.rotation.z = angle;
57
- }
58
- }
@@ -1,9 +0,0 @@
1
- import * as THREE from 'three';
2
- import type { DisplayProps } from '../../Stage/types';
3
- import type { GridLayerProps } from '../../GridLayer/types';
4
- import { type MeasurementLayerProps } from '../types';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export declare class CircleMeasurement extends BaseMeasurement {
7
- constructor(startPoint: THREE.Vector2, measurementProps: MeasurementLayerProps, displayProps: DisplayProps, gridProps: GridLayerProps);
8
- renderShape(): void;
9
- }
@@ -1,66 +0,0 @@
1
- // prettier-ignore
2
- import * as THREE from 'three';
3
- import { MeasurementType } from '../types';
4
- import { drawCircle } from '../utils/canvasDrawing';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export class CircleMeasurement extends BaseMeasurement {
7
- constructor(startPoint, measurementProps, displayProps, gridProps) {
8
- super(MeasurementType.Circle, startPoint, measurementProps, displayProps, gridProps);
9
- }
10
- renderShape() {
11
- // Calculate radius in pixels
12
- const radiusPixels = this.startPoint.distanceTo(this.endPoint);
13
- // Create canvas for the circle
14
- const canvas = document.createElement('canvas');
15
- const context = canvas.getContext('2d', { colorSpace: 'srgb' });
16
- // Calculate canvas size - need to accommodate the full circle plus outline and points
17
- const padding = Math.max(this.markerSize + this.outlineThickness, 40);
18
- const canvasSize = (radiusPixels + padding) * 2;
19
- canvas.width = Math.max(canvasSize, 100);
20
- canvas.height = Math.max(canvasSize, 100);
21
- // Clear canvas
22
- context.clearRect(0, 0, canvas.width, canvas.height);
23
- // Canvas center coordinates
24
- const canvasCenterX = canvas.width / 2;
25
- const canvasCenterY = canvas.height / 2;
26
- // Draw the large circle with dashed pattern
27
- // First draw the fill
28
- context.fillStyle = this.color;
29
- context.globalAlpha = 0.2;
30
- context.beginPath();
31
- context.arc(canvasCenterX, canvasCenterY, radiusPixels, 0, Math.PI * 2);
32
- context.fill();
33
- context.globalAlpha = 1.0;
34
- // Draw the outline with dashed pattern if needed
35
- if (this.outlineThickness > 0) {
36
- context.strokeStyle = this.outlineColor;
37
- context.lineWidth = this.thickness + this.outlineThickness * 2;
38
- context.setLineDash([20, 10]); // Dashed pattern
39
- context.beginPath();
40
- context.arc(canvasCenterX, canvasCenterY, radiusPixels, 0, Math.PI * 2);
41
- context.stroke();
42
- }
43
- // Draw the main stroke with dashed pattern
44
- context.strokeStyle = this.color;
45
- context.lineWidth = this.thickness;
46
- context.setLineDash([20, 10]); // Dashed pattern
47
- context.beginPath();
48
- context.arc(canvasCenterX, canvasCenterY, radiusPixels, 0, Math.PI * 2);
49
- context.stroke();
50
- // Reset dash pattern for other elements
51
- context.setLineDash([]);
52
- // Draw center point
53
- drawCircle(context, canvasCenterX, canvasCenterY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
54
- // Draw radius indicator point at the edge of the circle
55
- // Calculate the position of the end point relative to start point, then place on circle edge
56
- const direction = this.endPoint.clone().sub(this.startPoint).normalize();
57
- const edgeX = canvasCenterX + direction.x * radiusPixels;
58
- const edgeY = canvasCenterY - direction.y * radiusPixels; // Invert Y for canvas coordinates
59
- drawCircle(context, edgeX, edgeY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
60
- // Create texture from canvas
61
- const shapeTexture = new THREE.CanvasTexture(canvas);
62
- shapeTexture.needsUpdate = true;
63
- this.updateShapeMesh(new THREE.PlaneGeometry(canvas.width, canvas.height), shapeTexture);
64
- this.shapeMesh.position.set(this.startPoint.x, this.startPoint.y, 0);
65
- }
66
- }
@@ -1,10 +0,0 @@
1
- import * as THREE from 'three';
2
- import type { DisplayProps } from '../../Stage/types';
3
- import type { GridLayerProps } from '../../GridLayer/types';
4
- import { type MeasurementLayerProps } from '../types';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export declare class ConeMeasurement extends BaseMeasurement {
7
- private coneAngle;
8
- constructor(startPoint: THREE.Vector2, measurementProps: MeasurementLayerProps, displayProps: DisplayProps, gridProps: GridLayerProps);
9
- renderShape(): void;
10
- }
@@ -1,103 +0,0 @@
1
- // prettier-ignore
2
- import * as THREE from 'three';
3
- import { MeasurementType } from '../types';
4
- import { drawCircle } from '../utils/canvasDrawing';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export class ConeMeasurement extends BaseMeasurement {
7
- constructor(startPoint, measurementProps, displayProps, gridProps) {
8
- super(MeasurementType.Cone, startPoint, measurementProps, displayProps, gridProps);
9
- this.coneAngle = measurementProps.coneAngle;
10
- }
11
- renderShape() {
12
- // Calculate cone parameters
13
- const radius = this.startPoint.distanceTo(this.endPoint);
14
- const direction = this.endPoint.clone().sub(this.startPoint);
15
- const centerAngle = Math.atan2(direction.y, direction.x);
16
- // Convert cone angle from degrees to radians and calculate start/end angles
17
- const coneAngleRad = (this.coneAngle * Math.PI) / 180;
18
- const startAngle = centerAngle - coneAngleRad / 2;
19
- const endAngle = centerAngle + coneAngleRad / 2;
20
- // Create canvas for the cone
21
- const canvas = document.createElement('canvas');
22
- const context = canvas.getContext('2d', { colorSpace: 'srgb' });
23
- // Calculate canvas size - accommodate full cone plus padding
24
- const padding = Math.max(this.markerSize + this.outlineThickness, 40);
25
- const canvasSize = (radius + padding) * 2;
26
- canvas.width = Math.max(canvasSize, 100);
27
- canvas.height = Math.max(canvasSize, 100);
28
- // Clear canvas
29
- context.clearRect(0, 0, canvas.width, canvas.height);
30
- // Canvas center coordinates
31
- const canvasCenterX = canvas.width / 2;
32
- const canvasCenterY = canvas.height / 2;
33
- // Draw cone with dashed pattern
34
- if (radius > 0) {
35
- // First draw the fill
36
- context.fillStyle = this.color;
37
- context.globalAlpha = 0.2;
38
- context.beginPath();
39
- context.moveTo(canvasCenterX, canvasCenterY);
40
- context.arc(canvasCenterX, canvasCenterY, radius, -startAngle, -endAngle, true);
41
- context.closePath();
42
- context.fill();
43
- context.globalAlpha = 1.0;
44
- // Draw the outline with dashed pattern if needed
45
- if (this.outlineThickness > 0) {
46
- context.strokeStyle = this.outlineColor;
47
- context.lineWidth = this.thickness + this.outlineThickness * 2;
48
- context.setLineDash([20, 10]); // Dashed pattern
49
- // Draw the arc
50
- context.beginPath();
51
- context.arc(canvasCenterX, canvasCenterY, radius, -startAngle, -endAngle, true);
52
- context.stroke();
53
- // Draw the sides
54
- context.beginPath();
55
- context.moveTo(canvasCenterX, canvasCenterY);
56
- context.lineTo(canvasCenterX + Math.cos(-startAngle) * radius, canvasCenterY + Math.sin(-startAngle) * radius);
57
- context.stroke();
58
- context.beginPath();
59
- context.moveTo(canvasCenterX, canvasCenterY);
60
- context.lineTo(canvasCenterX + Math.cos(-endAngle) * radius, canvasCenterY + Math.sin(-endAngle) * radius);
61
- context.stroke();
62
- }
63
- // Draw the main stroke with dashed pattern
64
- context.strokeStyle = this.color;
65
- context.lineWidth = this.thickness;
66
- context.setLineDash([20, 10]); // Dashed pattern
67
- // Draw the arc
68
- context.beginPath();
69
- context.arc(canvasCenterX, canvasCenterY, radius, -startAngle, -endAngle, true);
70
- context.stroke();
71
- // Draw the sides
72
- context.beginPath();
73
- context.moveTo(canvasCenterX, canvasCenterY);
74
- context.lineTo(canvasCenterX + Math.cos(-startAngle) * radius, canvasCenterY + Math.sin(-startAngle) * radius);
75
- context.stroke();
76
- context.beginPath();
77
- context.moveTo(canvasCenterX, canvasCenterY);
78
- context.lineTo(canvasCenterX + Math.cos(-endAngle) * radius, canvasCenterY + Math.sin(-endAngle) * radius);
79
- context.stroke();
80
- // Reset dash pattern for other elements
81
- context.setLineDash([]);
82
- }
83
- // Draw center point (cone origin)
84
- drawCircle(context, canvasCenterX, canvasCenterY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
85
- // Draw point at the center of the cone's end arc (invert Y for canvas coordinates)
86
- const endPointX = canvasCenterX + Math.cos(centerAngle) * radius;
87
- const endPointY = canvasCenterY - Math.sin(centerAngle) * radius;
88
- drawCircle(context, endPointX, endPointY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
89
- // Draw points at the cone's edges (invert Y for canvas coordinates)
90
- const startEdgeX = canvasCenterX + Math.cos(startAngle) * radius;
91
- const startEdgeY = canvasCenterY - Math.sin(startAngle) * radius;
92
- drawCircle(context, startEdgeX, startEdgeY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
93
- const endEdgeX = canvasCenterX + Math.cos(endAngle) * radius;
94
- const endEdgeY = canvasCenterY - Math.sin(endAngle) * radius;
95
- drawCircle(context, endEdgeX, endEdgeY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
96
- // Create texture from canvas
97
- const texture = new THREE.CanvasTexture(canvas);
98
- texture.needsUpdate = true;
99
- this.updateShapeMesh(new THREE.PlaneGeometry(canvas.width, canvas.height), texture);
100
- // Position the cone at the start point (cone origin) in world coordinates
101
- this.shapeMesh.position.set(this.startPoint.x, this.startPoint.y, 0);
102
- }
103
- }
@@ -1,9 +0,0 @@
1
- import * as THREE from 'three';
2
- import type { DisplayProps } from '../../Stage/types';
3
- import type { GridLayerProps } from '../../GridLayer/types';
4
- import { type MeasurementLayerProps } from '../types';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export declare class LineMeasurement extends BaseMeasurement {
7
- constructor(startPoint: THREE.Vector2, measurementProps: MeasurementLayerProps, displayProps: DisplayProps, gridProps: GridLayerProps);
8
- renderShape(): void;
9
- }
@@ -1,75 +0,0 @@
1
- // prettier-ignore
2
- import * as THREE from 'three';
3
- import { MeasurementType } from '../types';
4
- import { drawCircle } from '../utils/canvasDrawing';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export class LineMeasurement extends BaseMeasurement {
7
- constructor(startPoint, measurementProps, displayProps, gridProps) {
8
- super(MeasurementType.Line, startPoint, measurementProps, displayProps, gridProps);
9
- }
10
- renderShape() {
11
- // Create canvas for the line
12
- const canvas = document.createElement('canvas');
13
- const context = canvas.getContext('2d', { colorSpace: 'srgb' });
14
- // Calculate the bounding box of the line
15
- const minX = Math.min(this.startPoint.x, this.endPoint.x);
16
- const maxX = Math.max(this.startPoint.x, this.endPoint.x);
17
- const minY = Math.min(this.startPoint.y, this.endPoint.y);
18
- const maxY = Math.max(this.startPoint.y, this.endPoint.y);
19
- // Add padding for line thickness and circles at endpoints
20
- const endpointRadius = (this.markerSize + this.outlineThickness) * 2;
21
- const padding = Math.max(endpointRadius, 20);
22
- const width = maxX - minX + padding * 2;
23
- const height = maxY - minY + padding * 2;
24
- canvas.width = width;
25
- canvas.height = height;
26
- // Clear canvas
27
- context.clearRect(0, 0, canvas.width, canvas.height);
28
- // Transform coordinates: Three.js world space -> Canvas space
29
- // Canvas origin is top-left, Three.js origin is center of the plane
30
- const startX = this.startPoint.x - minX + padding;
31
- const startY = canvas.height - (this.startPoint.y - minY + padding); // Invert Y
32
- const endX = this.endPoint.x - minX + padding;
33
- const endY = canvas.height - (this.endPoint.y - minY + padding); // Invert Y
34
- // Draw the line with dashed pattern
35
- // First draw the outline if needed
36
- if (this.outlineThickness > 0) {
37
- context.strokeStyle = this.outlineColor;
38
- context.lineWidth = this.thickness + this.outlineThickness * 2;
39
- context.lineCap = 'round';
40
- context.lineJoin = 'round';
41
- // Set dash pattern for outline
42
- const dashLength = 20;
43
- const gapLength = 10;
44
- context.setLineDash([dashLength, gapLength]);
45
- context.beginPath();
46
- context.moveTo(startX, startY);
47
- context.lineTo(endX, endY);
48
- context.stroke();
49
- }
50
- // Draw the main line with dashed pattern
51
- context.strokeStyle = this.color;
52
- context.lineWidth = this.thickness;
53
- context.lineCap = 'round';
54
- context.lineJoin = 'round';
55
- // Set dash pattern - adjust based on line thickness for good visual proportion
56
- const dashLength = 20;
57
- const gapLength = 10;
58
- context.setLineDash([dashLength, gapLength]);
59
- context.beginPath();
60
- context.moveTo(startX, startY);
61
- context.lineTo(endX, endY);
62
- context.stroke();
63
- // Reset dash pattern for other elements
64
- context.setLineDash([]);
65
- // Start point circle
66
- drawCircle(context, startX, startY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
67
- // End point circle
68
- drawCircle(context, endX, endY, this.markerSize / 2, this.color, this.outlineColor, this.outlineThickness);
69
- // Create texture from canvas
70
- const texture = new THREE.CanvasTexture(canvas);
71
- texture.needsUpdate = true;
72
- this.updateShapeMesh(new THREE.PlaneGeometry(canvas.width, canvas.height), texture);
73
- this.shapeMesh.position.set(minX + width / 2 - padding, minY + height / 2 - padding, 0);
74
- }
75
- }
@@ -1,9 +0,0 @@
1
- import * as THREE from 'three';
2
- import type { DisplayProps } from '../../Stage/types';
3
- import type { GridLayerProps } from '../../GridLayer/types';
4
- import { type MeasurementLayerProps } from '../types';
5
- import { BaseMeasurement } from './BaseMeasurement';
6
- export declare class RectangleMeasurement extends BaseMeasurement {
7
- constructor(startPoint: THREE.Vector2, measurementProps: MeasurementLayerProps, displayProps: DisplayProps, gridProps: GridLayerProps);
8
- renderShape(): void;
9
- }