Skip to content

Commit 3723856

Browse files
committed
update docs
1 parent b747b6b commit 3723856

File tree

4 files changed

+6
-158
lines changed

4 files changed

+6
-158
lines changed

docs/examples/brep_explorer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
viewer = App()
2424

2525
viewmesh = A.to_viewmesh()
26-
# viewer.add(viewmesh[0], show_edges=False, opacity=0.5)
2726
viewer.add(Collection(viewmesh[1]), linewidth=1, linecolor=Color(0.2, 0.2, 0.2))
2827

2928
viewer.add(vertex.point, color=Color.red(), size=20)
Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
from compas.geometry import Point, Vector, Plane
2-
from compas.geometry import Polyline
32
from compas.geometry import Box, Cylinder
43
from compas_occ.brep import BRep
54
from compas_view2.app import App
6-
5+
from compas_view2.objects import Collection
76

87
R = 1.4
98
P = Point(0, 0, 0)
@@ -24,53 +23,25 @@
2423
B2 = BRep.from_cylinder(cy)
2524
B3 = BRep.from_cylinder(cz)
2625

27-
# C = BRep.from_boolean_difference(
28-
# A,
29-
# BRep.from_boolean_union(
30-
# BRep.from_boolean_union(B1, B2),
31-
# B3
32-
# )
33-
# )
34-
3526
C = A - (B1 + B2 + B3)
3627

3728
# ==============================================================================
3829
# Visualisation
3930
# ==============================================================================
4031

32+
# C.data = C.data
33+
4134
# Currently, the viewer does not suppport BRep shapes.
4235
# Therefore we have to convert the components of the BRep to something the viewer does understand.
4336

44-
mesh = C.to_tesselation()
45-
46-
lines = []
47-
circles = []
48-
ellipses = []
49-
50-
for edge in C.edges:
51-
if edge.is_line:
52-
lines.append(edge.to_line())
53-
elif edge.is_circle:
54-
circles.append(Polyline(edge.curve.locus()))
55-
elif edge.is_ellipse:
56-
ellipses.append(Polyline(edge.curve.locus()))
57-
else:
58-
raise NotImplementedError
59-
6037
viewer = App(viewmode="ghosted", width=1600, height=900)
6138
viewer.view.camera.rz = -30
6239
viewer.view.camera.rx = -75
6340
viewer.view.camera.distance = 7
6441

65-
viewer.add(mesh, show_edges=False)
66-
67-
for line in lines:
68-
viewer.add(line, linewidth=2)
69-
70-
for circle in circles:
71-
viewer.add(circle, linewidth=2)
42+
viewmesh = C.to_viewmesh()
7243

73-
for ellipse in ellipses:
74-
viewer.add(ellipse, linewidth=2)
44+
viewer.add(viewmesh[0], show_edges=False)
45+
viewer.add(Collection(viewmesh[1]), linewidth=2)
7546

7647
viewer.run()

docs/examples/brep_overlap.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
FA, FB = A.overlap(B)
1616

17-
# for face in faces:
18-
# print(face)
19-
2017
viewer = App()
2118

2219
viewmesh = A.to_viewmesh()

docs/examples/temp/nsided.py

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)