It will not suffice a simple Annotation.zohozer wrote: ↑Wed Jan 26, 2022 8:48 am
You misunderstood the request. And yes, it is necessary because otherwise you can't determinate the grain direction of the
PART. Nobody asks to add a property for vertexes, lines, etc. but one property/part that indicates the grain direction like described in this pictures. And since other CAD softwares have this feature I think it is useful and practical to have such an information. This information is compliant with the IFC specifications so maybe mr. Yorik can take a look into this?
@Yorik has introduced something similar for Arch WB.
You will Find it in Draft.
Sadly something is not correct with my Linux install about Qt default fonts, so it is not immediate to show the results.
But if I set it "manually" with a Script:
Code: Select all
obj = Part.makeBox(100, 100, 100)
Part.show(obj, "cube")
obj = DOC.findObjects(Label="cube")[0]
colorlist = []
for face in obj.Shape.Faces:
colorlist.append((0.33, 0.25, 0.10))
fr_fc = obj.Shape.Faces[1]
fc2_cen= fr_fc.CenterOfMass
colorlist[1] = (0.68, 0.95, 0.95)
obj.ViewObject.DiffuseColor = colorlist
o_l = Draft.make_text(["Description", "Grain Direction"], fc2_cen)
o_l.ViewObject.Justification = "Center"
o_l.ViewObject.DisplayMode = u"2D text"
o_l.ViewObject.FontSize = 10
print(fr_fc.tangentAt(0.5,0.5))
symbol = (
(fc2_cen.x, fc2_cen.y - 20, fc2_cen.z + 10),
(fc2_cen.x, fc2_cen.y + 20, fc2_cen.z + 10),
(fc2_cen.x, fc2_cen.y - 20, fc2_cen.z - 10),
(fc2_cen.x, fc2_cen.y + 20, fc2_cen.z - 10)
)
grain_s = Part.makePolygon(symbol)
Part.show(grain_s, "symbol")
obj_s = DOC.findObjects(Label="symbol")[0]
obj_s.ViewObject.LineColor = (0.95, 0.0, 0.0)
Maybe not the best solution, but it is very near the scope.
Some assumptions could be done using the fr_fc.tangentAt(0.5,0.5) to obtain the face orientation and make the symbol alligned with the face in a more elegant way.
It is all managed by standard constructs, no exotic things.
It simple a "symbol made using lines" line placed at the center of the face, you could obtain the face normal or tangent (I've used simple values, if face is planar there are no problem, if not some math could maybe involved, but I'm not an expert of vector math)
EDIT: see https://forum.freecadweb.org/viewtopic. ... 26#p565426, maybe it will lead to something interesting.
Regards
Carlo D.