-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
229d9ee
commit 8aeaeee
Showing
35 changed files
with
265 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
from compas.geometry import Plane, Circle | ||
from compas_occ.brep import BRepEdge, BRepLoop, BRepFace, BRep | ||
from compas_view2.app import App | ||
# type: ignore | ||
|
||
plane = Plane.worldXY() | ||
from compas.geometry import Frame, Plane, Circle | ||
from compas_occ.brep import OCCBrepEdge, OCCBrepLoop, OCCBrepFace | ||
from compas.brep import Brep | ||
from compas_view2.app import App | ||
|
||
circle1 = Circle(Plane([2, 2, 0], [0, 0, 1]), 1.0) | ||
circle2 = Circle(Plane([-2, -2, 0], [0, 0, 1]), 2.0) | ||
circle3 = Circle(Plane([2, -2, 0], [0, 0, 1]), 0.5) | ||
circle1 = Circle(1.0, frame=Frame([2, 2, 0])) | ||
circle2 = Circle(2.0, frame=Frame([-2, -2, 0])) | ||
circle3 = Circle(0.5, frame=Frame([2, -2, 0])) | ||
|
||
loop1 = BRepLoop.from_edges([BRepEdge.from_circle(circle1)]) | ||
loop2 = BRepLoop.from_edges([BRepEdge.from_circle(circle2)]) | ||
loop3 = BRepLoop.from_edges([BRepEdge.from_circle(circle3)]) | ||
loop1 = OCCBrepLoop.from_edges([OCCBrepEdge.from_circle(circle1)]) | ||
loop2 = OCCBrepLoop.from_edges([OCCBrepEdge.from_circle(circle2)]) | ||
loop3 = OCCBrepLoop.from_edges([OCCBrepEdge.from_circle(circle3)]) | ||
|
||
face = BRepFace.from_plane(plane, udomain=(-5, 5), vdomain=(-5, 5)) | ||
face = OCCBrepFace.from_plane(Plane.worldXY(), udomain=(-5, 5), vdomain=(-5, 5)) | ||
face.add_loops([loop1, loop2, loop3], reverse=True) | ||
|
||
brep = BRep.from_faces([face]) | ||
brep = Brep.from_brepfaces([face]) | ||
|
||
viewer = App() | ||
viewer.add(brep, show_lines=False) | ||
|
||
for edge in brep.edges: | ||
if edge.is_line: | ||
viewer.add(edge.to_line(), linewidth=2) | ||
elif edge.is_circle: | ||
viewer.add(edge.curve.to_polyline(), linewidth=2) | ||
|
||
viewer.add(brep, linewidth=2) | ||
viewer.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.