Skip to content

Commit 2cb8141

Browse files
committed
FIX: execption for GH_IO commit
1 parent e8f6cd7 commit 2cb8141

File tree

11 files changed

+1269
-382
lines changed

11 files changed

+1269
-382
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*.so
1919
*.dylib
2020
*.dll
21+
# except for GH_IO.dll
22+
!GH_IO.dll
2123

2224
# Fortran module files
2325
*.mod
95 KB
Binary file not shown.

src/diffCheckBindings.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,10 @@ PYBIND11_MODULE(diffcheck_bindings, m) {
8181
.def_property("colors_face",
8282
[](const diffCheck::geometry::DFMesh &self) { return self.ColorsFace; },
8383
[](diffCheck::geometry::DFMesh &self, const std::vector<Eigen::Vector3d>& value) { self.ColorsFace = value; });
84+
85+
// //#################################################################################################
86+
// // df_registration namespace
87+
// //#################################################################################################
88+
89+
// py::module_ submodule_geometry = m.def_submodule("df_registration", "A submodule for the registration methods.");
8490
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#! python3
2+
3+
import System
4+
5+
import Rhino
6+
import Rhino.Geometry as rg
7+
from ghpythonlib.componentbase import executingcomponent as component
8+
9+
import Grasshopper as gh
10+
from Grasshopper.Kernel import GH_RuntimeMessageLevel as RML
11+
12+
import diffCheck
13+
from diffCheck import diffcheck_bindings
14+
import diffCheck.df_geometries
15+
import diffCheck.df_cvt_bindings
16+
17+
18+
class DFLoadMeshFromFile(component):
19+
def RunScript(self,
20+
i_path : str,
21+
i_scalef : float
22+
) -> rg.PointCloud:
23+
"""
24+
This compoonent load a mesh rhino from a ply file.
25+
26+
:param i_path: path to the ply file
27+
:param i_scalef: scale factor
28+
29+
:return o_mesh: rhino mesh
30+
"""
31+
print(f"diffCheck version: {diffCheck.__version__}")
32+
33+
df_cloud = diffcheck_bindings.dfb_geometry.DFPointCloud()
34+
df_cloud.load_from_PLY(i_path)
35+
rgpoints = [rg.Point3d(pt[0], pt[1], pt[2]) for pt in df_cloud.points]
36+
rh_cloud = rg.PointCloud(rgpoints)
37+
38+
# scale if needed
39+
centroid = rh_cloud.GetBoundingBox(True).Center
40+
x_form_scale = rg.Transform.Scale(centroid, i_scalef)
41+
rh_cloud.Transform(x_form_scale)
42+
43+
44+
rh_mesh = rh_cloud
45+
46+
return rh_mesh
47+
48+
49+
# if __name__ == "__main__":
50+
# com = DFLoadMeshFromFile()
51+
# o_rh_mesh = com.RunScript(
52+
# i_path,
53+
# i_scalef
54+
# )
15.4 KB
Loading
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "DFLoadMeshFromFile",
3+
"nickname": "MeshFFile",
4+
"category": "diffCheck",
5+
"subcategory": "Mesh",
6+
"description": "This is a test component.",
7+
"exposure": 4,
8+
"instanceGuid": "e5319472-39ee-4b53-ba3c-9ae37af08610",
9+
"ghpython": {
10+
"hideOutput": true,
11+
"hideInput": true,
12+
"isAdvancedMode": true,
13+
"marshalOutGuids": true,
14+
"iconDisplay": 2,
15+
"inputParameters": [
16+
{
17+
"name": "i_path",
18+
"nickname": "i_path",
19+
"description": "Path of the file (e.g. .ply) to import",
20+
"optional": true,
21+
"allowTreeAccess": true,
22+
"showTypeHints": true,
23+
"scriptParamAccess": "item",
24+
"wireDisplay": "default",
25+
"sourceCount": 0,
26+
"typeHintID": "str"
27+
},
28+
{
29+
"name": "i_scalef",
30+
"nickname": "i_scalef",
31+
"description": "Scaling factor to adapt the unit of the imported file to the rhino document.",
32+
"optional": false,
33+
"allowTreeAccess": true,
34+
"showTypeHints": true,
35+
"scriptParamAccess": "item",
36+
"wireDisplay": "default",
37+
"sourceCount": 0,
38+
"typeHintID": "float"
39+
}
40+
],
41+
"outputParameters": [
42+
{
43+
"name": "o_rh_mesh",
44+
"nickname": "o_rh_mesh",
45+
"description": "The imported mesh.",
46+
"optional": false,
47+
"sourceCount": 0,
48+
"graft": false
49+
}
50+
]
51+
}
52+
}

src/gh/diffCheck/diffCheck.egg-info/PKG-INFO

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ Home-page: https://github.com/diffCheckOrg/diffCheck
66
Author: Andrea Settimi, Damien Gilliard, Eleni Skevaki, Marirena Kladeftira, Julien Gamerro, Stefana Parascho, and Yves Weinand
77
Author-email: andrea.settimi@epfl.ch
88
License: UNKNOWN
9-
Description: # DiffCheck Grasshopper Plugin
10-
11-
DiffCheck is a plugin for Rhino/Grasshopper that allows the user to compare a 3D model with its scan.
12-
13-
More information to come
149
Platform: UNKNOWN
1510
Classifier: License :: OSI Approved :: MIT License
1611
Classifier: Programming Language :: Python :: 3
1712
Classifier: Programming Language :: Python :: 3.9
1813
Description-Content-Type: text/markdown
14+
15+
# DiffCheck Grasshopper Plugin
16+
17+
DiffCheck is a plugin for Rhino/Grasshopper that allows the user to compare a 3D model with its scan.
18+
19+
More information to come
20+
Binary file not shown.

src/gh/diffCheck/diffCheck/df_cvt_bindings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def cvt_rhcloud_2_dfcloud(rh_cloud) -> diffcheck_bindings.dfb_geometry.DFPointCl
3939

4040
return df_cloud
4141

42-
4342
def cvt_dfcloud_2_rhcloud(df_cloud):
4443
"""
4544
Convert a diffCheck cloud to a Rhino cloud.
@@ -99,6 +98,7 @@ def cvt_dfmesh_2_rhmesh(df_mesh: diffcheck_bindings.dfb_geometry.DFMesh) -> rg.M
9998

10099
# faces
101100
for face in df_mesh.faces:
101+
print(face)
102102
rh_mesh.Faces.AddFace(face[0], face[1], face[2])
103103

104104
# normals

src/gh/diffCheck/diffCheck/df_geometries.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import diffCheck.df_joint_detector
1414

15+
1516
@dataclass
1617
class DFVertex:
1718
"""

0 commit comments

Comments
 (0)