Skip to content

Feats: extract additional beam/joints data for results csv export #143

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

Merged
merged 19 commits into from
Nov 29, 2024
Merged

Conversation

9and3
Copy link
Contributor

@9and3 9and3 commented Nov 27, 2024

Description

This is a PR to integrate some useful (at least for me) features during the AC evaluation. Mainly it's about extracting extra info from the beam and joints' geometries and exporting it in the CSV/.diffCheck. Basically all the extraction of the geometric features is done in the df_geometries.py module and the export is a plug-in in the csv row preparation function:

# Add extra geometric info based on analysis type here:
if i_result.analysis_type == "beam":
row.update({
"beam_length": i_result.assembly.beams[idx].length
})
elif i_result.analysis_type == "joint":
# NB:: for conviniency, if there is only one beam, we add the lenght of the beam i nthe joint csv analysis output
if i_result.assembly.has_only_one_beam:
row.update({
"beam_length": i_result.assembly.beams[0].length
})
row.update({
"joint_distance_to_beam_midpoint": i_result.assembly.compute_all_joint_distances_to_midpoint()[idx]
})
elif i_result.analysis_type == "joint_face":
row.update({
"jointface_angle": i_result.assembly.compute_all_joint_angles()[idx]
})

Important

@DamienGilliard this is not tested for round woods. I believe that everything should work with basic cylinders.

New features

  • DFBeam.compute_axis(): integrated a function that properly extract the axis from the beam. It takes the two farthest joints' centroids and build the vector axis from it (a888e99)
  • extract/export beam length: get the length of the above beam axis (DFBeam.length) and export it through the CSV. (8b047e6)
  • extract/export relative position of joinst from beam's center: this is some data I need to assess if there is really a deformation in my AR mapping. Feat design: Each joint's centroid is project to the beam's axis >> measure projection to center distance (signed) >> export on csv (8b047e6)
  • extract/export jointface angles: this is calculated between the normal of the joint face and the beam's axis. Feat design: detect face norma >> bring the axis and normal to the same direction >> calculate angles >> export (8b047e6)

Changes

  • new output for the component DFExportResults of the generated path for better debugging (b34ac88)

Fixes

@9and3 9and3 self-assigned this Nov 27, 2024
@9and3 9and3 added enhancement New feature or request grasshopper PythonAPI labels Nov 27, 2024
@9and3 9and3 changed the title Feats: extract additional info for results square beams Feats: extract additional beam/joints data for results csv export Nov 27, 2024
@9and3 9and3 marked this pull request as ready for review November 28, 2024 10:25
@9and3
Copy link
Contributor Author

9and3 commented Nov 28, 2024

rfr @DamienGilliard / @eleniv3d in case you have a moment free.

@DamienGilliard
Copy link
Collaborator

I'll take a look tomorrow !

Copy link
Collaborator

@DamienGilliard DamienGilliard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went through it, nothing to report 👍
df_geometries really starts to be quite rich, certainly with the "state" logic.
Thanks !

@@ -37,13 +37,14 @@ def __post_init__(self):
self.__uuid = uuid.uuid4().int

def __getstate__(self):
return self.__dict__
state = self.__dict__.copy()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned something today :)

@9and3
Copy link
Contributor Author

9and3 commented Nov 29, 2024

Went through it, nothing to report 👍 df_geometries really starts to be quite rich, certainly with the "state" logic. Thanks !

And tedious if you ask.. Now everytime you add a variable you need to serialize it with this state thing. But for now it is what it is.

Thanks for the review!

@9and3 9and3 merged commit 330a4ff into main Nov 29, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DFPreview is laggy and beams' axis off
2 participants