-
Notifications
You must be signed in to change notification settings - Fork 4
adaptations for cylindical beams #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nice! @DamienGilliard have you already tried also with square sections for compatibility by any chance? |
…te association threshold
|
Hello @DamienGilliard , following up our meeting I marked the issue about not taking in acoount the holes in the |
indeed correct. At least we keep the same limitation everywhere for curved elements. I really want to take the time to review this PR properly since it introduces some nice feats and changes, hold on please @DamienGilliard :) |
…osite assemblies (logs + squared)
9and3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @DamienGilliard ! I left my comments and feedback here and there. The biggest remark I have is on the choice of the name cylinder, I thought that it would make more sense to have "roundwood" since for the other we used beam, something more related to the type of timber rather than the shape.
Let's take the time to close this properly, we can also discuss tomorrow at the lab if needed ! 👐
| siffed_df_cloud_source_list = [] | ||
| siffed_rh_mesh_target_list = [] | ||
| for i in range(len(i_cloud_source)): | ||
| if i_cloud_source[i] is not None: | ||
| siffed_df_cloud_source_list.append(df_cvt_bindings.cvt_rhcloud_2_dfcloud(i_cloud_source[i])) | ||
| siffed_rh_mesh_target_list.append(rh_mesh_target_list[i]) | ||
|
|
||
|
|
||
| # calculate distances | ||
| o_result = df_error_estimation.df_cloud_2_rh_mesh_comparison(df_cloud_source_list, rh_mesh_target_list, i_signed_flag, i_swap) | ||
| o_result = df_error_estimation.df_cloud_2_rh_mesh_comparison(siffed_df_cloud_source_list, siffed_rh_mesh_target_list, i_signed_flag, i_swap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe to be cordinate with @eleniv3d ?
| face = DFFace.from_brep_face(data[0], data[1]) | ||
| faces.append(face) | ||
| beam = cls("Beam", faces) | ||
| beam.is_cylinder = is_cylinder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above
| ''' | ||
| the structure of the disctionnary is as follows: | ||
| { | ||
| face_id: (face, is_inside) | ||
| ... | ||
| } | ||
| face_id is int | ||
| face is Rhino.Geometry.BrepFace | ||
| is_inside is bool | ||
| ''' | ||
| faces = {} | ||
| if is_cylinder_beam: | ||
| for idx, face in enumerate(self.brep.Faces): | ||
| faces[idx] = (face, face.IsPlanar(1000 * sc.doc.ModelAbsoluteTolerance)) | ||
| else: | ||
| for idx, face in enumerate(self.brep.Faces): | ||
| face_centroid = rg.AreaMassProperties.Compute(face).Centroid | ||
| coord = face.ClosestPoint(face_centroid) | ||
| projected_centroid = face.PointAt(coord[1], coord[2]) | ||
| faces[idx] = (face, Bounding_geometry.IsPointInside(projected_centroid, sc.doc.ModelAbsoluteTolerance, True)) | ||
|
|
||
| # compute the adjacency list of each face | ||
| adjacency_of_faces = {} | ||
| ''' | ||
| the structure of the dictionnary is as follows: | ||
| { | ||
| face_id: (face, [adj_face_id_1, adj_face_id_2, ...]) | ||
| ... | ||
| } | ||
| face_id is int | ||
| face is Rhino.Geometry.BrepFace | ||
| adj_face_id_1, adj_face_id_2, ... are int | ||
| ''' | ||
| for idx, face in faces.items(): | ||
| if not face[1]: | ||
| continue | ||
| adjacency_of_faces[idx] = (face[0], [adj_face for adj_face in face[0].AdjacentFaces() if faces[adj_face][1] and faces[adj_face][0].IsPlanar(1000 * sc.doc.ModelAbsoluteTolerance) and adj_face != idx]) # used to be not faces[adj_face][0].IsPlanar(1000 * sc.doc.ModelAbsoluteTolerance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose two things here:
- first it would be great if you can contain what you added in a function encapsualted inside the DFJointDetector (_my_cylinder_func()) with some docstrings explaining why you need this because it's a bit cumbersome like this.
- second I propose to do these to state clearly that what you added is needed only for cylinder beams right?
joint_face_ids = []
if is_cylinder_beam:
my_cylinder_treatement_func() # change name
else:
faces = {idx: (face, Bounding_geometry.IsPointInside(rg.AreaMassProperties.Compute(face).Centroid, sc.doc.ModelAbsoluteTolerance, True)) for idx, face in enumerate(self.brep.Faces)}
joint_face_ids = [[key] + [adj_face for adj_face in value[0].AdjacentFaces() if faces[adj_face][1] and adj_face != key] for key, value in faces.items() if value[1]]There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: I created two functions, one for each dictionnary:
faces = _find_joint_faces(self, bounding_geometry)
adjacency_of_faces = _compute_adjacency_of_faces(self, faces)
adjacency_of_faces = diffCheck.df_util.merge_shared_indexes(adjacency_of_faces)
joint_face_ids = [[key] + value[1] for key, value in adjacency_of_faces.items()]
9and3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookin good! Thanks @DamienGilliard ! 👐






This PR contains changes to make diffCheck work with cylindrical beams.
The main changes target:
df_joint_detector.pyChange log:
No additional test was made, the changes are mainly reliant on rhino and difficult to test. If you see something to test during the review, let me know !!