|
86 | 86 |
|
87 | 87 | from compas.plugins import plugin |
88 | 88 | from compas.artists import Artist |
89 | | - |
| 89 | +from compas.artists import ShapeArtist |
90 | 90 | from compas.geometry import Circle |
91 | 91 | from compas.geometry import Frame |
92 | 92 | from compas.geometry import Line |
|
141 | 141 | BaseArtist = RhinoArtist |
142 | 142 |
|
143 | 143 |
|
144 | | -@plugin(category='drawing-utils', pluggable_name='clear', requires=['Rhino']) |
| 144 | +ShapeArtist.default_color = (255, 255, 255) |
| 145 | + |
| 146 | +# MeshArtist.default_color = (0, 0, 0) |
| 147 | +# MeshArtist.default_vertexcolor = (255, 255, 255) |
| 148 | +# MeshArtist.default_edgecolor = (0, 0, 0) |
| 149 | +# MeshArtist.default_facecolor = (255, 255, 255) |
| 150 | + |
| 151 | +NetworkArtist.default_nodecolor = (255, 255, 255) |
| 152 | +NetworkArtist.default_edgecolor = (0, 0, 0) |
| 153 | + |
| 154 | +VolMeshArtist.default_color = (0, 0, 0) |
| 155 | +VolMeshArtist.default_vertexcolor = (255, 255, 255) |
| 156 | +VolMeshArtist.default_edgecolor = (0, 0, 0) |
| 157 | +VolMeshArtist.default_facecolor = (255, 255, 255) |
| 158 | +VolMeshArtist.default_cellcolor = (255, 0, 0) |
| 159 | + |
| 160 | + |
| 161 | +@plugin(category="drawing-utils", pluggable_name="clear", requires=["Rhino"]) |
145 | 162 | def clear_rhino(): |
146 | 163 | compas_rhino.clear() |
147 | 164 |
|
148 | 165 |
|
149 | | -@plugin(category='drawing-utils', pluggable_name='redraw', requires=['Rhino']) |
| 166 | +@plugin(category="drawing-utils", pluggable_name="redraw", requires=["Rhino"]) |
150 | 167 | def redraw_rhino(): |
151 | 168 | compas_rhino.redraw() |
152 | 169 |
|
153 | 170 |
|
154 | | -@plugin(category='factories', requires=['Rhino']) |
| 171 | +@plugin(category="factories", requires=["Rhino"]) |
155 | 172 | def register_artists(): |
156 | | - Artist.register(Circle, CircleArtist, context='Rhino') |
157 | | - Artist.register(Frame, FrameArtist, context='Rhino') |
158 | | - Artist.register(Line, LineArtist, context='Rhino') |
159 | | - Artist.register(Plane, PlaneArtist, context='Rhino') |
160 | | - Artist.register(Point, PointArtist, context='Rhino') |
161 | | - Artist.register(Polygon, PolygonArtist, context='Rhino') |
162 | | - Artist.register(Polyline, PolylineArtist, context='Rhino') |
163 | | - Artist.register(Vector, VectorArtist, context='Rhino') |
164 | | - Artist.register(Box, BoxArtist, context='Rhino') |
165 | | - Artist.register(Capsule, CapsuleArtist, context='Rhino') |
166 | | - Artist.register(Cone, ConeArtist, context='Rhino') |
167 | | - Artist.register(Cylinder, CylinderArtist, context='Rhino') |
168 | | - Artist.register(Polyhedron, PolyhedronArtist, context='Rhino') |
169 | | - Artist.register(Sphere, SphereArtist, context='Rhino') |
170 | | - Artist.register(Torus, TorusArtist, context='Rhino') |
171 | | - Artist.register(Mesh, MeshArtist, context='Rhino') |
172 | | - Artist.register(Network, NetworkArtist, context='Rhino') |
173 | | - Artist.register(VolMesh, VolMeshArtist, context='Rhino') |
174 | | - Artist.register(RobotModel, RobotModelArtist, context='Rhino') |
175 | | - Artist.register(Curve, CurveArtist, context='Rhino') |
176 | | - Artist.register(Surface, SurfaceArtist, context='Rhino') |
177 | | - print('Rhino Artists registered.') |
| 173 | + Artist.register(Circle, CircleArtist, context="Rhino") |
| 174 | + Artist.register(Frame, FrameArtist, context="Rhino") |
| 175 | + Artist.register(Line, LineArtist, context="Rhino") |
| 176 | + Artist.register(Plane, PlaneArtist, context="Rhino") |
| 177 | + Artist.register(Point, PointArtist, context="Rhino") |
| 178 | + Artist.register(Polygon, PolygonArtist, context="Rhino") |
| 179 | + Artist.register(Polyline, PolylineArtist, context="Rhino") |
| 180 | + Artist.register(Vector, VectorArtist, context="Rhino") |
| 181 | + Artist.register(Box, BoxArtist, context="Rhino") |
| 182 | + Artist.register(Capsule, CapsuleArtist, context="Rhino") |
| 183 | + Artist.register(Cone, ConeArtist, context="Rhino") |
| 184 | + Artist.register(Cylinder, CylinderArtist, context="Rhino") |
| 185 | + Artist.register(Polyhedron, PolyhedronArtist, context="Rhino") |
| 186 | + Artist.register(Sphere, SphereArtist, context="Rhino") |
| 187 | + Artist.register(Torus, TorusArtist, context="Rhino") |
| 188 | + Artist.register(Mesh, MeshArtist, context="Rhino") |
| 189 | + Artist.register(Network, NetworkArtist, context="Rhino") |
| 190 | + Artist.register(VolMesh, VolMeshArtist, context="Rhino") |
| 191 | + Artist.register(RobotModel, RobotModelArtist, context="Rhino") |
| 192 | + Artist.register(Curve, CurveArtist, context="Rhino") |
| 193 | + Artist.register(Surface, SurfaceArtist, context="Rhino") |
| 194 | + print("Rhino Artists registered.") |
178 | 195 |
|
179 | 196 |
|
180 | 197 | __all__ = [ |
181 | | - 'BaseArtist', |
182 | | - 'RhinoArtist', |
183 | | - 'CircleArtist', |
184 | | - 'FrameArtist', |
185 | | - 'LineArtist', |
186 | | - 'PlaneArtist', |
187 | | - 'PointArtist', |
188 | | - 'PolygonArtist', |
189 | | - 'PolylineArtist', |
190 | | - 'VectorArtist', |
191 | | - 'BoxArtist', |
192 | | - 'CapsuleArtist', |
193 | | - 'ConeArtist', |
194 | | - 'CylinderArtist', |
195 | | - 'PolyhedronArtist', |
196 | | - 'SphereArtist', |
197 | | - 'TorusArtist', |
198 | | - 'MeshArtist', |
199 | | - 'NetworkArtist', |
200 | | - 'VolMeshArtist', |
201 | | - 'RobotModelArtist', |
202 | | - 'CurveArtist', |
203 | | - 'SurfaceArtist', |
| 198 | + "BaseArtist", |
| 199 | + "RhinoArtist", |
| 200 | + "CircleArtist", |
| 201 | + "FrameArtist", |
| 202 | + "LineArtist", |
| 203 | + "PlaneArtist", |
| 204 | + "PointArtist", |
| 205 | + "PolygonArtist", |
| 206 | + "PolylineArtist", |
| 207 | + "VectorArtist", |
| 208 | + "BoxArtist", |
| 209 | + "CapsuleArtist", |
| 210 | + "ConeArtist", |
| 211 | + "CylinderArtist", |
| 212 | + "PolyhedronArtist", |
| 213 | + "SphereArtist", |
| 214 | + "TorusArtist", |
| 215 | + "MeshArtist", |
| 216 | + "NetworkArtist", |
| 217 | + "VolMeshArtist", |
| 218 | + "RobotModelArtist", |
| 219 | + "CurveArtist", |
| 220 | + "SurfaceArtist", |
204 | 221 | ] |
0 commit comments