KEERTHANAUDAY / timber_grammar

Shape grammar implementation for timber to timber connections
2 stars 1 forks source link

The distance of user picked point is not computed correctly #8

Open yck011522 opened 5 years ago

yck011522 commented 5 years ago

Issue https://github.com/KEERTHANAUDAY/timber_grammar/blob/c6701c1baf5d02341af35a0b91a3fe140ca27e0c/timber_grammar/src/timber_grammar/rhino_UI_Create_90Lap.py#L49-L50

The distance should be computed by computing the projection distance of the point to the Start Plane of the Beam. (As discussed)

Suggestion

Get_SelectPointOnMeshEdge return the point user picked, not the distance. The function which called Get_SelectPointOnMeshEdge() should compute the distance between that point to the Beam's start plane (I think it is YZ plane). You can use the following function.

https://compas-dev.github.io/main/api/generated/compas.geometry.distance_point_plane.html?highlight=distance#compas.geometry.distance_point_plane

KEERTHANAUDAY commented 5 years ago

https://github.com/KEERTHANAUDAY/timber_grammar/blob/1bfe13d1ff7277d046831baafb4bfcc202f111f3/src/timber_grammar/rhino_UI_Create_90Lap.py#L25-L54

https://github.com/KEERTHANAUDAY/timber_grammar/blob/1bfe13d1ff7277d046831baafb4bfcc202f111f3/src/timber_grammar/assembly_model.py#L223-L235

https://github.com/KEERTHANAUDAY/timber_grammar/blob/1bfe13d1ff7277d046831baafb4bfcc202f111f3/src/timber_grammar/Beam.py#L233-L234

1)the rhino_UI_90lap gets the Point3D of the selected point 2)A function in the assembly model computes the distance from the selected point to the YZplane of the Beam 3)A function in the Beam Class creates the YZplane

yck011522 commented 5 years ago

I think the Get_distancefromBeamYZFrame() function should reside inside the Beam class such that it can be reused by other functions. Should be some sort of function in Beam class maybe called point_distance_to_beam_start_plane()