Skip to content

Commit 09010cf

Browse files
Merge pull request #51 from bitbybit-dev/develop
Develop
2 parents 27ecaad + 8d03f62 commit 09010cf

5 files changed

Lines changed: 46 additions & 5 deletions

File tree

lib/api/inputs/occ-inputs.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,37 @@ export namespace OCCT {
162162
*/
163163
point: Base.Point3 = [0, 0, 0];
164164
}
165+
export class XYZDto {
166+
constructor(x?: number, y?: number, z?: number) {
167+
if (x !== undefined) { this.x = x; }
168+
if (y !== undefined) { this.y = y; }
169+
if (z !== undefined) { this.z = z; }
170+
}
171+
/**
172+
* X coord
173+
* @default 0
174+
* @minimum -Infinity
175+
* @maximum Infinity
176+
* @step 0.1
177+
*/
178+
x: number;
179+
/**
180+
* Y coord
181+
* @default 0
182+
* @minimum -Infinity
183+
* @maximum Infinity
184+
* @step 0.1
185+
*/
186+
y: number;
187+
/**
188+
* Z coord
189+
* @default 0
190+
* @minimum -Infinity
191+
* @maximum Infinity
192+
* @step 0.1
193+
*/
194+
z: number;
195+
}
165196
export class PointsDto {
166197
constructor(points?: Base.Point3[]) {
167198
if (points !== undefined) { this.points = points; }

lib/services/base/faces.service.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { WiresService } from "./wires.service";
99
import { BooleansService } from "./booleans.service";
1010
import { ConverterService } from "./converter.service";
1111
import { FilletsService } from "./fillets.service";
12-
import { IteratorService } from "./iterator.service";
1312

1413
export class FacesService {
1514

@@ -611,6 +610,13 @@ export class FacesService {
611610
}
612611

613612
subdivideToRectangleHoles(inputs: Inputs.OCCT.FaceSubdivisionToRectanglesDto<TopoDS_Face>): TopoDS_Face[] {
613+
// default should be smaller then 1 as that can't punch holes or create faces nicely.
614+
if (inputs.scalePatternU === undefined) {
615+
inputs.scalePatternU = [0.5];
616+
}
617+
if(inputs.scalePatternV === undefined){
618+
inputs.scalePatternV = [0.5];
619+
}
614620
const wires = this.subdivideToRectangleWires(inputs);
615621
const faceWires = this.shapeGettersService.getWires({ shape: inputs.shape });
616622
const wireLengths = this.wiresService.getWiresLengths({ shapes: faceWires });
@@ -626,7 +632,7 @@ export class FacesService {
626632
});
627633
}
628634
revWires.forEach(w => w.delete());
629-
635+
630636
return [newFace, ...faces];
631637
}
632638

lib/services/shapes/vertex.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ export class OCCTVertex {
1010
) {
1111
}
1212

13+
vertexFromXYZ(inputs: Inputs.OCCT.XYZDto): TopoDS_Vertex {
14+
return this.och.entitiesService.makeVertex([inputs.x, inputs.y, inputs.z]);
15+
}
16+
1317
vertexFromPoint(inputs: Inputs.OCCT.PointDto): TopoDS_Vertex {
1418
return this.och.entitiesService.makeVertex(inputs.point);
1519
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bitbybit-dev/occt",
3-
"version": "0.16.4",
3+
"version": "0.16.5",
44
"description": "Bit By Bit Developers CAD algorithms using OpenCascade Technology kernel. Run in Node and in Browser.",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)