Automatic arch wall extrusion direction

A forum dedicated to the Draft, Arch and BIM workbenches development.
User avatar
Roy_043
Veteran
Posts: 7678
Joined: Thu Dec 27, 2018 12:28 pm

Re: Automatic arch wall extrusion direction

Post by Roy_043 »

The calculated normal is correct IMO.
Attachments
Test_ DraftLine_ Rotation_ 01_normal.FCStd
(17.35 KiB) Downloaded 11 times
paullee
Veteran
Posts: 4967
Joined: Wed May 04, 2016 3:58 pm

Re: Automatic arch wall extrusion direction

Post by paullee »

OK, noted, thanks mentoring :)


On get_normal(), I would somehow skip checking view direction for the purpose discussed in this thread.

Code: Select all

def get_normal(shape, tol=-1):
...
    Default behaviour :

    If the Gui is up the normal is checked against the current view direction.
    If it points away from the viewer it is reversed.
...

    if App.GuiUp:
        v_dir = gui_utils.get_3d_view().getViewDirection()
        # TODO < math.pi/2 or < 0.78
        if normal.getAngle(v_dir) < math.pi/2:
            normal = normal.negative()
User avatar
Roy_043
Veteran
Posts: 7678
Joined: Thu Dec 27, 2018 12:28 pm

Re: Automatic arch wall extrusion direction

Post by Roy_043 »

Just use get_shape_normal instead of get_normal then.
paullee
Veteran
Posts: 4967
Joined: Wed May 04, 2016 3:58 pm

Re: Automatic arch wall extrusion direction

Post by paullee »

Would someone please test before I make a PR :)

EDIT - Thanks, Roy_043, basically your codes.

ArchWall.py
(81.27 KiB) Downloaded 11 times
DraftGeomUtils.py
(8.19 KiB) Downloaded 11 times
geometry.py
(25.7 KiB) Downloaded 10 times
Post Reply