Polygon¶
Declaration¶
- class declaracad.occ.draw.Polygon(parent=None, **kwargs)[source]¶
Bases:
PolylineA polyline that follows points on a circle of a given inscribed or circumscribed radius.
- Attributes:
- radius: Float
Radius of the polygon
- count: Int
Number of points in the polygon, must be 3 or more.
- inscribed: Bool
Whether the radius should be interpreted as an “inscribed” or “circumscribed” radius. The default is “circumscribed” meaning the points will be on the given radius (inside the circle). If inscribed=True then the midpoint of each segment will be on the circle of the given radius (outside the circle).
Methods
activate_bottom_up()Initialize the proxy on the bottom-up activation pass.
activate_proxy()Activate the proxy object tree.
activate_top_down()Initialize the proxy on the top-down activation pass.
child_added(child)A reimplemented child added event handler.
child_moved(child)A method invoked when a child is moved in the object.
child_removed(child)A reimplemented child removed event handler.
destroy()A reimplemented destructor.
find(name[, regex])Find the first object in the subtree with the given name.
find_all(name[, regex])Find all objects in the subtree with the given name.
freezeFreeze the atom to prevent further modifications to its attributes.
get_memberGet the named member for the atom.
get_value_at(t[, derivative])Get the value of the curve derivative at t.
has_observerGet whether the atom has the given observer for a given topic.
has_observersGet whether the atom has observers for a given topic.
initialize()A reimplemented initializer.
insert_children(before, insert)Insert children into this object at the given location.
members()Get the members dictionary for the type.
notifications_enabledGet whether notification is enabled for the atom.
notifyCall the registered observers for a given topic with positional and keyword arguments.
observeRegister an observer callback to observe changes on the given topic(s).
parent_changed(old, new)A method invoked when the parent of the object changes.
points_of_discontinuity([tolerance])Find points of discontinuity
render()Generates and returns the actual shape from the declaration.
root_object()Get the root object for this hierarchy.
set_notifications_enabledEnable or disable notifications for the atom.
set_parent(parent)Set the parent for this object.
suppress_notifications()Disable member notifications within in a context.
traverse([depth_first])Yield all of the objects in the tree, from this object down.
traverse_ancestors([root])Yield all of the objects in the tree, from this object up.
unobserveUnregister an observer callback for the given topic(s).
line_style
Examples
- Wire:
- Polygon: # A hexagon of radius 6
radius = 4 count = 6
- closed = True¶
This is fixed
- count¶
Number of points
- inscribed¶
Radius is inscribed
- points¶
List of points
- radius¶
Radius of the polygon
No implementation found