Arch: Added oddtopus's fixes to Arch Frame

This commit is contained in:
Yorik van Havre 2017-02-04 14:41:32 -02:00
parent 216d8c66dc
commit 095d462cba

View File

@ -74,7 +74,7 @@ class _CommandFrame:
return {'Pixmap' : 'Arch_Frame',
'MenuText': QT_TRANSLATE_NOOP("Arch_Frame","Frame"),
'Accel': "F, R",
'ToolTip': QT_TRANSLATE_NOOP("Arch_Frame","Creates a frame object from a planar 2D object and a profile")}
'ToolTip': QT_TRANSLATE_NOOP("Arch_Frame","Creates a frame object from a planar 2D object (the extrusion path(s)) and a profile. Make sure objects are selected in that order.")}
def IsActive(self):
return not FreeCAD.ActiveDocument is None
@ -100,8 +100,10 @@ class _Frame(ArchComponent.Component):
obj.addProperty("App::PropertyBool","Align","Arch",QT_TRANSLATE_NOOP("App::Property","Specifies if the profile must be aligned with the extrusion wires"))
obj.addProperty("App::PropertyVectorDistance","Offset","Arch",QT_TRANSLATE_NOOP("App::Property","An offset vector between the base sketch and the frame"))
obj.addProperty("App::PropertyInteger","BasePoint","Arch",QT_TRANSLATE_NOOP("App::Property","Crossing point of the path on the profile."))
obj.addProperty("App::PropertyPlacement","ProfilePlacement","Arch",QT_TRANSLATE_NOOP("App::Property","An optional additional placement to add to the profile before extruding it"))
obj.addProperty("App::PropertyAngle","Rotation","Arch",QT_TRANSLATE_NOOP("App::Property","The rotation of the profile around its extrusion axis"))
self.Type = "Frame"
obj.Align = True
obj.Role = Roles
def execute(self,obj):
@ -136,6 +138,9 @@ class _Frame(ArchComponent.Component):
return
import DraftGeomUtils, Part, math
baseprofile = obj.Profile.Shape.copy()
if hasattr(obj,"ProfilePlacement"):
if not obj.ProfilePlacement.isNull():
baseprofile.Placement = obj.ProfilePlacement.multiply(baseprofile.Placement)
if not baseprofile.Faces:
f = []
for w in baseprofile.Wires: