Skip to content

cylinder_2p in negative z-direction #810

@AGeissler

Description

@AGeissler

Trying to create a cylinder_2p object with cylinder extrusion in negativ z-direction leads to "ZeroDivisionError" ('float division'). Tracing this back leads to forms.py and the call in line 849 to reference_frame_z(), line 1275.

The code would seem to lack a check of extrusion direction as in the function 'reference_frame_ext()', which according to the code documentation would seem the correct function to be called, as the heading direction is parallel to the z-axis (WCS).

I experimentally added
try:
return UCS(uy=Z_AXIS.cross(heading), uz=heading, origin=origin)
except ZeroDivisionError:
return(reference_frame_ext(UCS(heading), origin=origin))

in line 1275 ff. (forms.py) and this seems to work (no extensive tests done, however).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions