-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
COCKATOO_MakeRenderGraph.py
45 lines (37 loc) · 1.23 KB
/
COCKATOO_MakeRenderGraph.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""
Get the segmentation for loop generation and assign segment attributes
to 'weft' edges and vertices.
TODO: Update docstring!
Inputs:
Toggle: {item, boolean}
KnitNetwork: An initialized KnitNetwork. {item, KnitNetwork}
Output:
RenderGraph: The KnitNetwork with 'weft' connections created. {item, polyline}
Remarks:
Author: Max Eschenbach
License: Apache License 2.0
Version: 200414
"""
# PYTHON STANDARD LIBRARY IMPORTS
from __future__ import division
# GPYTHON SDK IMPORTS
from ghpythonlib.componentbase import executingcomponent as component
import Grasshopper, GhPython
import System
import Rhino
import rhinoscriptsyntax as rs
# LOCAL MODULE IMPORTS
import Cockatoo
# GHENV COMPONENT SETTINGS
ghenv.Component.Name = "MakeRenderGraph"
ghenv.Component.NickName ="MRG"
ghenv.Component.Category = "COCKATOO"
ghenv.Component.SubCategory = "7 Visualisation"
class MakeRenderGraph(component):
def RunScript(self, Toggle, KN):
if Toggle and KN:
RenderGraph = KN.MakeRenderGraph(True)
else:
RenderGraph = Grasshopper.DataTree[object]()
# return outputs if you have them; here I try it for you:
return RenderGraph