Skip to content

Commit 222b090

Browse files
committed
horizontal conduit
1 parent 8e94997 commit 222b090

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/compas_rv/conduits/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from .horizontalconduit import HorizontalConduit
2+
3+
__all__ = [
4+
"HorizontalConduit"
5+
]
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import System # type: ignore
2+
3+
from compas_rhino.conduits import BaseConduit
4+
5+
from Rhino.Geometry import Point3d
6+
from Rhino.Geometry import Line
7+
8+
from System.Collections.Generic import List
9+
10+
11+
class HorizontalConduit(BaseConduit):
12+
13+
def __init__(self, lines, **kwargs):
14+
super(HorizontalConduit, self).__init__(**kwargs)
15+
self._default_thickness = 1.0
16+
self._default_color = System.Drawing.Color.FromArgb(255, 255, 255)
17+
self.lines = lines or []
18+
19+
def DrawForeground(self, e):
20+
lines = List[Line](len(self.lines))
21+
for start, end in self.lines:
22+
lines.Add(Line(Point3d(start[0], start[1], 0), Point3d(end[0], end[1], 0)))
23+
e.Display.DrawLines(lines, self._default_color, self._default_thickness)

0 commit comments

Comments
 (0)