@bitbybit-dev/jscad 0.20.14 → 0.21.1

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 Bit By Bit Developers
3
+ Copyright (c) 2026 Bit by bit developers
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -65,7 +65,7 @@ export declare namespace JSCAD {
65
65
  /**
66
66
  * Provide options without default values
67
67
  */
68
- constructor(mesh?: JSCADEntity, opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, jscadMesh?: T);
68
+ constructor(mesh?: JSCADEntity, opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, jscadMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number);
69
69
  /**
70
70
  * Solid Jscad mesh
71
71
  */
@@ -100,12 +100,30 @@ export declare namespace JSCAD {
100
100
  * @ignore true
101
101
  */
102
102
  jscadMesh?: T;
103
+ /**
104
+ * Draw two-sided faces with different colors for front and back. This helps visualize face orientation.
105
+ * @default true
106
+ */
107
+ drawTwoSided: boolean;
108
+ /**
109
+ * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true.
110
+ * @default #0000ff
111
+ */
112
+ backFaceColour: string;
113
+ /**
114
+ * Back face opacity value between 0 and 1. Only used when drawTwoSided is true.
115
+ * @default 1
116
+ * @minimum 0
117
+ * @maximum 1
118
+ * @step 0.1
119
+ */
120
+ backFaceOpacity: number;
103
121
  }
104
122
  class DrawSolidMeshesDto<T> {
105
123
  /**
106
124
  * Provide options without default values
107
125
  */
108
- constructor(meshes?: JSCADEntity[], opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, jscadMesh?: T);
126
+ constructor(meshes?: JSCADEntity[], opacity?: number, colours?: string | string[], updatable?: boolean, hidden?: boolean, jscadMesh?: T, drawTwoSided?: boolean, backFaceColour?: string, backFaceOpacity?: number);
109
127
  /**
110
128
  * Solid Jscad meshes
111
129
  * @default undefined
@@ -142,6 +160,24 @@ export declare namespace JSCAD {
142
160
  * @ignore true
143
161
  */
144
162
  jscadMesh?: T;
163
+ /**
164
+ * Draw two-sided faces with different colors for front and back. This helps visualize face orientation.
165
+ * @default true
166
+ */
167
+ drawTwoSided: boolean;
168
+ /**
169
+ * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true.
170
+ * @default #0000ff
171
+ */
172
+ backFaceColour: string;
173
+ /**
174
+ * Back face opacity value between 0 and 1. Only used when drawTwoSided is true.
175
+ * @default 1
176
+ * @minimum 0
177
+ * @maximum 1
178
+ * @step 0.1
179
+ */
180
+ backFaceOpacity: number;
145
181
  }
146
182
  class DrawPathDto<T> {
147
183
  /**
@@ -69,7 +69,7 @@ export var JSCAD;
69
69
  /**
70
70
  * Provide options without default values
71
71
  */
72
- constructor(mesh, opacity, colours, updatable, hidden, jscadMesh) {
72
+ constructor(mesh, opacity, colours, updatable, hidden, jscadMesh, drawTwoSided, backFaceColour, backFaceOpacity) {
73
73
  /**
74
74
  * Value between 0 and 1
75
75
  * @default 1
@@ -93,6 +93,24 @@ export var JSCAD;
93
93
  * @default false
94
94
  */
95
95
  this.hidden = false;
96
+ /**
97
+ * Draw two-sided faces with different colors for front and back. This helps visualize face orientation.
98
+ * @default true
99
+ */
100
+ this.drawTwoSided = true;
101
+ /**
102
+ * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true.
103
+ * @default #0000ff
104
+ */
105
+ this.backFaceColour = "#0000ff";
106
+ /**
107
+ * Back face opacity value between 0 and 1. Only used when drawTwoSided is true.
108
+ * @default 1
109
+ * @minimum 0
110
+ * @maximum 1
111
+ * @step 0.1
112
+ */
113
+ this.backFaceOpacity = 1;
96
114
  if (mesh !== undefined) {
97
115
  this.mesh = mesh;
98
116
  }
@@ -111,6 +129,15 @@ export var JSCAD;
111
129
  if (jscadMesh !== undefined) {
112
130
  this.jscadMesh = jscadMesh;
113
131
  }
132
+ if (drawTwoSided !== undefined) {
133
+ this.drawTwoSided = drawTwoSided;
134
+ }
135
+ if (backFaceColour !== undefined) {
136
+ this.backFaceColour = backFaceColour;
137
+ }
138
+ if (backFaceOpacity !== undefined) {
139
+ this.backFaceOpacity = backFaceOpacity;
140
+ }
114
141
  }
115
142
  }
116
143
  JSCAD.DrawSolidMeshDto = DrawSolidMeshDto;
@@ -118,7 +145,7 @@ export var JSCAD;
118
145
  /**
119
146
  * Provide options without default values
120
147
  */
121
- constructor(meshes, opacity, colours, updatable, hidden, jscadMesh) {
148
+ constructor(meshes, opacity, colours, updatable, hidden, jscadMesh, drawTwoSided, backFaceColour, backFaceOpacity) {
122
149
  /**
123
150
  * Value between 0 and 1
124
151
  * @default 1
@@ -142,6 +169,24 @@ export var JSCAD;
142
169
  * @default false
143
170
  */
144
171
  this.hidden = false;
172
+ /**
173
+ * Draw two-sided faces with different colors for front and back. This helps visualize face orientation.
174
+ * @default true
175
+ */
176
+ this.drawTwoSided = true;
177
+ /**
178
+ * Hex colour string for back face colour (negative side of the face). Only used when drawTwoSided is true.
179
+ * @default #0000ff
180
+ */
181
+ this.backFaceColour = "#0000ff";
182
+ /**
183
+ * Back face opacity value between 0 and 1. Only used when drawTwoSided is true.
184
+ * @default 1
185
+ * @minimum 0
186
+ * @maximum 1
187
+ * @step 0.1
188
+ */
189
+ this.backFaceOpacity = 1;
145
190
  if (meshes !== undefined) {
146
191
  this.meshes = meshes;
147
192
  }
@@ -160,6 +205,15 @@ export var JSCAD;
160
205
  if (jscadMesh !== undefined) {
161
206
  this.jscadMesh = jscadMesh;
162
207
  }
208
+ if (drawTwoSided !== undefined) {
209
+ this.drawTwoSided = drawTwoSided;
210
+ }
211
+ if (backFaceColour !== undefined) {
212
+ this.backFaceColour = backFaceColour;
213
+ }
214
+ if (backFaceOpacity !== undefined) {
215
+ this.backFaceOpacity = backFaceOpacity;
216
+ }
163
217
  }
164
218
  }
165
219
  JSCAD.DrawSolidMeshesDto = DrawSolidMeshesDto;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitbybit-dev/jscad",
3
- "version": "0.20.14",
3
+ "version": "0.21.1",
4
4
  "description": "Bit By Bit Developers JSCAD based CAD Library to Program Geometry",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -58,7 +58,7 @@
58
58
  "types": "./index.d.ts",
59
59
  "type": "module",
60
60
  "dependencies": {
61
- "@bitbybit-dev/base": "0.20.14",
61
+ "@bitbybit-dev/base": "0.21.1",
62
62
  "@jscad/io-utils": "2.0.28",
63
63
  "@jscad/modeling": "2.12.3",
64
64
  "@jscad/stl-serializer": "2.1.18",