Assembly: JCS selection: cones surfaces offers the cone's apex. Fixes #13958

This commit is contained in:
PaddleStroke
2024-05-14 16:46:48 +02:00
committed by Chris Hennes
parent 7ee83f9610
commit 7c2a95bb0d

View File

@@ -921,13 +921,15 @@ def findPlacement(obj, part, elt, vtx, ignoreVertex=False):
# First we find the translation
if vtx_type == "Face" or ignoreVertex:
if surface.TypeId == "Part::GeomCylinder" or surface.TypeId == "Part::GeomCone":
if surface.TypeId == "Part::GeomCylinder":
centerOfG = face.CenterOfGravity - surface.Center
centerPoint = surface.Center + centerOfG
centerPoint = centerPoint + App.Vector().projectToLine(centerOfG, surface.Axis)
plc.Base = centerPoint
elif surface.TypeId == "Part::GeomTorus" or surface.TypeId == "Part::GeomSphere":
plc.Base = surface.Center
elif surface.TypeId == "Part::GeomCone":
plc.Base = surface.Apex
else:
plc.Base = face.CenterOfGravity
elif vtx_type == "Edge":