Skip to content

Commit cc97b35

Browse files
committed
CAP: working code and tested components for registrations, missing icons
1 parent 47a0e87 commit cc97b35

File tree

4 files changed

+38
-52
lines changed

4 files changed

+38
-52
lines changed

invokes/ghcomponentize/ghcomponentizer.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
valid=set([0, 1, 2]), map=dict(default=0, faint=1, hidden=2), default=0
6161
)
6262

63-
6463
def fetch_ghio_lib(target_folder="temp"):
6564
"""Fetch the GH_IO.dll library from the NuGet packaging system."""
6665
ghio_dll = "GH_IO.dll"
@@ -76,25 +75,21 @@ def fetch_ghio_lib(target_folder="temp"):
7675

7776
return dst_file
7877

79-
8078
def find_ghio_assembly(libdir):
8179
for root, _dirs, files in os.walk(libdir):
8280
for basename in files:
8381
if basename.upper() == "GH_IO.DLL":
8482
filename = os.path.join(root, basename)
8583
return filename
8684

87-
8885
def bitmap_from_image_path(image_path):
8986
with open(image_path, "rb") as imageFile:
9087
# Ensure img_string is a string, not a bytes object
9188
img_string = base64.b64encode(imageFile.read())
9289
if isinstance(img_string, bytes):
9390
img_string = img_string.decode()
94-
9591
# Now you can pass img_string to the FromBase64String method
9692
return System.Convert.FromBase64String(img_string)
97-
# return System.Convert.FromBase64String(img_string)
9893

9994

10095
def validate_source_bundle(source):
@@ -164,10 +159,8 @@ def parse_param_access(access):
164159
sorted(ACCESS["valid"])
165160
)
166161
)
167-
168162
return access
169163

170-
171164
def parse_wire_display(wire_display):
172165
try:
173166
wire_display = int(wire_display)
@@ -180,10 +173,8 @@ def parse_wire_display(wire_display):
180173
sorted(WIRE_DISPLAY["valid"])
181174
)
182175
)
183-
184176
return wire_display
185177

186-
187178
def parse_param_type_hint(type_hint_id):
188179
type_hint_id = type_hint_id or PARAM_TYPE["default"]
189180

@@ -214,7 +205,6 @@ def replace_templates(code, version, name, ghuser_name):
214205

215206
return code
216207

217-
218208
def create_ghuser_component(source, target, version=None, prefix=None):
219209
from GH_IO.Serialization import GH_LooseChunk
220210

@@ -256,9 +246,6 @@ def create_ghuser_component(source, target, version=None, prefix=None):
256246
ghpython_root.SetString("NickName", data["nickname"])
257247
ghpython_root.SetBoolean("MarshalGuids", ghpython_data.get("marshalGuids", True))
258248

259-
# ghpython_root.CreateChunk('Attributes')
260-
# for mf in ('Bounds', 'Pivot', 'Selected'):
261-
262249
params = ghpython_root.CreateChunk("ParameterData")
263250
inputParam = ghpython_data.get("inputParameters", [])
264251
outputParam = ghpython_data.get("outputParameters", [])
@@ -329,7 +316,6 @@ def create_ghuser_component(source, target, version=None, prefix=None):
329316
language_spec.SetString("Taxon", "*.*.python")
330317
language_spec.SetString("Version", CPY_VER)
331318

332-
# xml_serialized = ghpython_root.Serialize_Xml()
333319
root.SetByteArray("Object", ghpython_root.Serialize_Binary())
334320
System.IO.File.WriteAllBytes(target, root.Serialize_Binary())
335321

src/gh/components/DF_fast_global_registration/code.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,20 @@ def RunScript(self,
8383
if rh_form == rg.Transform.Identity:
8484
ghenv.Component.AddRuntimeMessage(RML.Warning, "The transformation matrix is identity, no transformation is applied")
8585
return None
86-
86+
8787
o_x_form = rh_form
8888

8989
return o_x_form
9090

9191

92-
if __name__ == "__main__":
93-
com = DFFastGlobalRegistration()
94-
o_x_form = com.RunScript(
95-
i_cloud_source,
96-
i_cloud_target,
97-
i_radius_kd_search,
98-
i_neighbours_kd_search,
99-
i_max_corrspondence_dist,
100-
i_iteration_number,
101-
i_max_tuple_count
102-
)
92+
# if __name__ == "__main__":
93+
# com = DFFastGlobalRegistration()
94+
# o_x_form = com.RunScript(
95+
# i_cloud_source,
96+
# i_cloud_target,
97+
# i_radius_kd_search,
98+
# i_neighbours_kd_search,
99+
# i_max_corrspondence_dist,
100+
# i_iteration_number,
101+
# i_max_tuple_count
102+
# )

src/gh/components/DF_icp_registration/code.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,17 @@ def RunScript(self,
105105
return o_x_form
106106

107107

108-
if __name__ == "__main__":
109-
com = ICPRegistration()
110-
o_x_form = com.RunScript(
111-
i_cloud_source,
112-
i_cloud_target,
108+
# if __name__ == "__main__":
109+
# com = ICPRegistration()
110+
# o_x_form = com.RunScript(
111+
# i_cloud_source,
112+
# i_cloud_target,
113113

114-
i_use_generalized_icp,
114+
# i_use_generalized_icp,
115115

116-
i_max_corrspondence_dist,
117-
i_max_iteration,
116+
# i_max_corrspondence_dist,
117+
# i_max_iteration,
118118

119-
is_t_estimate_pt2pt,
120-
i_use_point_to_plane
121-
)
119+
# is_t_estimate_pt2pt,
120+
# i_use_point_to_plane
121+
# )

src/gh/components/DF_ransac_global_registration/code.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ def RunScript(self,
107107
return o_x_form
108108

109109

110-
if __name__ == "__main__":
111-
com = DFRANSACGlobalRegistration()
112-
o_x_form = com.RunScript(
113-
i_cloud_source,
114-
i_cloud_target,
115-
i_radius_kd_search,
116-
i_neighbours_kd_search,
117-
i_max_corrspondence_dist,
118-
is_t_estimate_pt2pt,
119-
i_ransac_n,
120-
i_checker_dist,
121-
i_similarity_threshold,
122-
i_max_iterations,
123-
i_confidence_threshold
124-
)
110+
# if __name__ == "__main__":
111+
# com = DFRANSACGlobalRegistration()
112+
# o_x_form = com.RunScript(
113+
# i_cloud_source,
114+
# i_cloud_target,
115+
# i_radius_kd_search,
116+
# i_neighbours_kd_search,
117+
# i_max_corrspondence_dist,
118+
# is_t_estimate_pt2pt,
119+
# i_ransac_n,
120+
# i_checker_dist,
121+
# i_similarity_threshold,
122+
# i_max_iterations,
123+
# i_confidence_threshold
124+
# )

0 commit comments

Comments
 (0)