|
21 | 21 | import time |
22 | 22 |
|
23 | 23 | from OCC.Core.BRep import BRep_Tool |
24 | | -from OCC.Core.BRepAdaptor import BRepAdaptor_HCurve |
| 24 | +from OCC.Core.BRepAdaptor import BRepAdaptor_Curve |
25 | 25 | from OCC.Core.BRepBuilderAPI import BRepBuilderAPI_MakePolygon |
26 | 26 | from OCC.Core.BRepFill import BRepFill_CurveConstraint |
27 | 27 | from OCC.Display.SimpleGui import init_display |
28 | 28 | from OCC.Core.GeomAbs import GeomAbs_C0 |
29 | 29 | from OCC.Core.GeomLProp import GeomLProp_SLProps |
30 | 30 | from OCC.Core.GeomPlate import ( |
31 | 31 | GeomPlate_BuildPlateSurface, |
| 32 | + GeomPlate_CurveConstraint, |
32 | 33 | GeomPlate_PointConstraint, |
33 | 34 | GeomPlate_MakeApprox, |
34 | 35 | ) |
@@ -134,9 +135,8 @@ def build_plate(polygon, points): |
134 | 135 | # add curve constraints |
135 | 136 | for poly in polygon: |
136 | 137 | for edg in WireExplorer(poly).ordered_edges(): |
137 | | - c = BRepAdaptor_HCurve() |
138 | | - c.ChangeCurve().Initialize(edg) |
139 | | - constraint = BRepFill_CurveConstraint(c, 0) |
| 138 | + c = BRepAdaptor_Curve(edg) |
| 139 | + constraint = GeomPlate_CurveConstraint(c, 0) |
140 | 140 | bpSrf.Add(constraint) |
141 | 141 |
|
142 | 142 | # add point constraint |
@@ -253,10 +253,8 @@ def build_geom_plate(edges): |
253 | 253 |
|
254 | 254 | # add curve constraints |
255 | 255 | for edg in edges: |
256 | | - c = BRepAdaptor_HCurve() |
257 | | - print("edge:", edg) |
258 | | - c.ChangeCurve().Initialize(edg) |
259 | | - constraint = BRepFill_CurveConstraint(c, 0) |
| 256 | + c = BRepAdaptor_Curve(edg) |
| 257 | + constraint = GeomPlate_CurveConstraint(c, 0) |
260 | 258 | bpSrf.Add(constraint) |
261 | 259 |
|
262 | 260 | # add point constraint |
|
0 commit comments