Skip to content

ec.rotate_elements inverts geometry when rotation axis vector has zero-length #162

@Brunner246

Description

@Brunner246

Discussed in #161

Originally posted by roehligas March 22, 2024
Hi,

When elements are rotated around a vector with 0 magnitude (for example [0,0,0] or in my case [0,-0,0]), the geometry gets inverted/destroyed.

Are there use cases where this behavior is desired? If not I suggest throwing an Error when the rotation axis has zero-length.
Took me a very long time to figure out where the problem actually was coming from because it randomly fell together with the desired rotation direction for my use case, so the elements got turned but were broken after...


import element_controller as ec
import cadwork as cw
import math

active_elements= ec.get_active_identifiable_element_ids()
ec.rotate_elements(active_elements, cw.point_3d(0,0,0), cw.point_3d(0,0,0), math.pi)

image
image
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions