Length in Manual Quantification
Hi all,
I'm trying "Manual Quantification" with a linear object (paint on a pavement) but the length values I get are not correct (or maybe I'm not interpreting what it calculates correctly). It seems that the values returned by the function are the length component on each axis but not the total length (looking at the "calculator.py" file in the qto module, it seems that the "get_length" function is the one that does the work).
Can someone clarify if I'm right?
Comments
@avico hi, could you share the IFC file? Have you tried to change the "calculation engine"?
I think you can try resetting (ctrl+A > rotation) the rotation of the original object/mesh before making it an IfcElement, if you
Tab
it you can see the box from where the dimensions come from (as also shown in your image), please advise@massimo,
I have tried IfcOpenShell and Blender as "Calculator" with the same result. I attach the object extracted from the original project to simplify. It has been generated by importing a dxf line and creating the mesh with modifiers (array and curve) with the "fit curve" option.
@steverugi, object has no rotation: looking properties in "Transform" panel ( push n key and "Item" button to show transformations in the object) show rotations are 0. When you say "Tab it" it means "Edit mode"?
guesswork here
the imported dxf shape can have a length only as 'box' because Blender/Bonsai don't have knowledge as to how the shape was built, only incidentally does it look like a longitudinal element
hopefully someone with some knowledge on the topic can step in to clarify.
@steverugi ,
the dxf is used to generate a mesh using a plane as base (to simulate the line width), array and curve modifiers along all curve (dxf object) and converted to mesh (apply all modifiers). In fact, the objec is a modified plane.
This is usefull when you want model dashed lines because you can control the distance between each stroke.
@avico hi, @steverugi was right, that value comes from the object "bounding box", so in this case, the bounding box is (a sort of) rotated and the result is what you have shown...
You could recreate the object bounding box according with the object direction somehow but unfortunately i don't know a smart way to do it...
@Massimo,
I don't know anything about python but I have tried a modification in the "get_length" function that seems to give correct results. Instead of "return max(x, y)", etc. I have used "return math.sqrt(pow(x,2)+ pow(y,2)+pow(z,2))". This, instead of returning the projection of the component on each span, returns the total length.
@avico ok that formula works for this case but in general it would give an incorrect result...
A more general solution would be to align the bounding box with the object direction...if i manage to do it i'll post it here
Thanks @Massimo