Skip to content

Commit

Permalink
Draft: Added a 'solid faces' projection mode to shape2dviews to treat…
Browse files Browse the repository at this point in the history
… individual faces
  • Loading branch information
yorikvanhavre committed Apr 30, 2021
1 parent e2e3806 commit ccc4151
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Mod/Draft/draftobjects/shape2dview.py
Expand Up @@ -99,7 +99,7 @@ def __init__(self,obj):

obj.Projection = App.Vector(0,0,1)
obj.ProjectionMode = ["Solid", "Individual Faces",
"Cutlines", "Cutfaces"]
"Cutlines", "Cutfaces","Solid faces"]
obj.HiddenLines = False
obj.Tessellation = False
obj.VisibleOnly = False
Expand Down Expand Up @@ -200,8 +200,13 @@ def execute(self,obj):
cuts = []
opl = App.Placement(obj.Base.Placement)
proj = opl.Rotation.multVec(App.Vector(0, 0, 1))
if obj.ProjectionMode == "Solid":
for sh in shapes:
if obj.ProjectionMode in ["Solid","Solid faces"]:
shapes_to_cut = shapes
if obj.ProjectionMode == "Solid faces":
shapes_to_cut = []
for s in shapes:
shapes_to_cut.extend(s.Faces)
for sh in shapes_to_cut:
if cutv:
if sh.Volume < 0:
sh.reverse()
Expand Down

0 comments on commit ccc4151

Please sign in to comment.