@@ -39,7 +39,6 @@ export class OccHelper {
3939 points . push ( pt2g ) ;
4040 } catch {
4141 }
42- crvHandle . delete ( ) ;
4342 } ) ;
4443 if ( points . length > 0 ) {
4544 points = this . vecHelper . removeAllDuplicateVectors ( points ) ;
@@ -454,7 +453,6 @@ export class OccHelper {
454453 } else {
455454 const edge = this . bRepBuilderAPIMakeEdge ( circle ) ;
456455 if ( type === typeSpecificityEnum . edge ) {
457- circle . delete ( ) ;
458456 return edge ;
459457 } else {
460458 const circleWire = this . bRepBuilderAPIMakeWire ( edge ) ;
@@ -477,7 +475,6 @@ export class OccHelper {
477475 } else {
478476 const edge = this . bRepBuilderAPIMakeEdge ( ellipse ) ;
479477 if ( type === typeSpecificityEnum . edge ) {
480- ellipse . delete ( ) ;
481478 return edge ;
482479 } else {
483480 const ellipseWire = this . bRepBuilderAPIMakeWire ( edge ) ;
@@ -620,7 +617,8 @@ export class OccHelper {
620617 divideEdgeByParamsToPoints ( inputs : Inputs . OCCT . DivideDto < TopoDS_Edge > ) : Inputs . Base . Point3 [ ] {
621618 const edge = inputs . shape ;
622619 const { uMin, uMax } = this . getEdgeBounds ( edge ) ;
623- const curve = this . getGeomCurveFromEdge ( edge , uMin , uMax ) ;
620+ const wire = this . combineEdgesAndWiresIntoAWire ( { shapes : [ edge ] } ) ;
621+ const curve = new this . occ . BRepAdaptor_CompCurve_2 ( wire , false ) ;
624622 return this . divideCurveToNrSegments ( { ...inputs , shape : curve } , uMin , uMax ) ;
625623 }
626624
@@ -639,7 +637,6 @@ export class OccHelper {
639637 const param = this . remap ( inputs . param , 0 , 1 , uMin , uMax ) ;
640638 curve . D0 ( param , gpPnt ) ;
641639 const pt : Base . Point3 = [ gpPnt . X ( ) , gpPnt . Y ( ) , gpPnt . Z ( ) ] ;
642- curve . delete ( ) ;
643640 gpPnt . delete ( ) ;
644641 return pt ;
645642 }
@@ -651,7 +648,6 @@ export class OccHelper {
651648 const param = this . remap ( inputs . param , 0 , 1 , uMin , uMax ) ;
652649 const vec = curve . DN ( param , 1 ) ;
653650 const vector : Base . Vector3 = [ vec . X ( ) , vec . Y ( ) , vec . Z ( ) ] ;
654- curve . delete ( ) ;
655651 vec . delete ( ) ;
656652 return vector ;
657653 }
@@ -1222,26 +1218,29 @@ export class OccHelper {
12221218
12231219 startPointOnEdge ( inputs : Inputs . OCCT . ShapeDto < TopoDS_Edge > ) : Base . Point3 {
12241220 const edge = inputs . shape ;
1225- const { uMin, uMax } = this . getEdgeBounds ( edge ) ;
1226- const curve = this . getGeomCurveFromEdge ( edge , uMin , uMax ) ;
1227- let res = this . startPointOnCurve ( { ...inputs , shape : curve } ) ;
1228- curve . delete ( ) ;
1221+ const wire = this . combineEdgesAndWiresIntoAWire ( { shapes : [ edge ] } ) ;
1222+ let res = this . pointOnWireAtParam ( { shape : wire , param : 0 } ) ;
1223+ return res ;
1224+ }
1225+
1226+ endPointOnEdge ( inputs : Inputs . OCCT . ShapeDto < TopoDS_Edge > ) : Base . Point3 {
1227+ const edge = inputs . shape ;
1228+ const wire = this . combineEdgesAndWiresIntoAWire ( { shapes : [ edge ] } ) ;
1229+ let res = this . pointOnWireAtParam ( { shape : wire , param : 1 } ) ;
12291230 return res ;
12301231 }
12311232
12321233 startPointOnWire ( inputs : Inputs . OCCT . ShapeDto < TopoDS_Wire > ) : Base . Point3 {
12331234 const wire = inputs . shape ;
12341235 const curve = new this . occ . BRepAdaptor_CompCurve_2 ( wire , false ) ;
12351236 let res = this . startPointOnCurve ( { ...inputs , shape : curve } ) ;
1236- curve . delete ( ) ;
12371237 return res ;
12381238 }
12391239
12401240 endPointOnWire ( inputs : Inputs . OCCT . ShapeDto < TopoDS_Wire > ) : Base . Point3 {
12411241 const wire = inputs . shape ;
12421242 const curve = new this . occ . BRepAdaptor_CompCurve_2 ( wire , false ) ;
12431243 let res = this . endPointOnCurve ( { ...inputs , shape : curve } ) ;
1244- curve . delete ( ) ;
12451244 return res ;
12461245 }
12471246
@@ -1267,8 +1266,6 @@ export class OccHelper {
12671266 const loc = edge . Location_1 ( ) ;
12681267 const crvHandle = this . occ . BRep_Tool . Curve_1 ( edge , loc , uMin , uMax ) ;
12691268 const curve = crvHandle . get ( ) ;
1270- crvHandle . delete ( ) ;
1271- loc . delete ( ) ;
12721269 return curve ;
12731270 }
12741271
0 commit comments