Arc¶
Declaration¶
- class declaracad.occ.draw.Arc(parent=None, **kwargs)[source]¶
Bases:
Line
Creates an Arc that can be used to build a Wire.
- Attributes:
- radius: Float, optional
The radius of the arc.
- alpha1: Float, optional
The starting angle of the arc.
- alpha2: Float, optional
The ending angle of the arc.
- clockwise: Bool
If using two points this gives the interpolation direction
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.
freeze
Freeze the atom to prevent further modifications to its attributes.
get_member
Get the named member for the atom.
get_value_at
(t[, derivative])Get the value of the curve derivative at t.
has_observer
Get whether the atom has the given observer for a given topic.
has_observers
Get 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_enabled
Get whether notification is enabled for the atom.
notify
Call the registered observers for a given topic with positional and keyword arguments.
observe
Register 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.
render
()Generates and returns the actual shape from the declaration.
root_object
()Get the root object for this hierarchy.
set_notifications_enabled
Enable 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.
unobserve
Unregister an observer callback for the given topic(s).
line_style
Notes
An arc can be constructed using:
three child Points
axis, radius, alpha 1, alpha 2
axis, radius, and two child Points
axis, radius, one child Point and alpha 1
Examples
import math Wire:
- Arc:
attr deg = 5 radius = 1 alpha1 = math.radians(deg) alpha2 = math.radians(deg+2)
- Wire:
- Arc:
- points = (
(1, 0, 0), (2, 5, 0), (3, 0, 0)
)
- Wire:
- Arc:
- solve = (
curve.topology.start_tangent, end_point,
)
- alpha1¶
Angle circle (optional)
- alpha2¶
2nd Angle circle (optional)
- clockwise¶
Clockwise (sweep direction, when using two points)
- proxy¶
Reference to the implementation control
- radius¶
Radius of the circle (optional)
Implementation¶
- class declaracad.occ.impl.occ_arc.OccArc[source]¶
Bases:
OccLine
,ProxyArc
- Attributes:
- ais_shape
- curve
- declaration
- displayed
is_active
Test whether or not the proxy is fully activated.
- location
- reference
- shape
- tdf_label
- topology
- viewer
Methods
activate_bottom_up
()Activate the proxy tree for the bottom-up pass.
activate_top_down
()Activate the proxy for the top-down pass.
child_added
(child)Handle a child being added to the object.
child_removed
(child)Handle a child being removed from the object.
child_shapes
()Iterator of all child shapes
children
()Get the child objects for this object.
create_arc_from_solver
(**params)Create an arc by solving the given parameters.
Create the toolkit shape for the proxy object.
destroy
()Destroy the proxy and any of its resources.
freeze
Freeze the atom to prevent further modifications to its attributes.
get_first_child
()Return shape to apply the operation to.
get_member
Get the named member for the atom.
get_transform
()Create a transform which rotates the default axis to align with the normal given by the position
has_observer
Get whether the atom has the given observer for a given topic.
has_observers
Get whether the atom has observers for a given topic.
init_layout
()Initialize the layout of the toolkit shape.
init_shape
()Initialize the state of the toolkit widget.
members
()Get the members dictionary for the type.
notifications_enabled
Get whether notification is enabled for the atom.
notify
Call the registered observers for a given topic with positional and keyword arguments.
observe
Register an observer callback to observe changes on the given topic(s).
parent
()Get the parent proxy object for this object.
set_notifications_enabled
Enable or disable notifications for the atom.
suppress_notifications
()Disable member notifications within in a context.
unobserve
Unregister an observer callback for the given topic(s).
walk_shapes
([ignore_display])Iterator of all child shapes
clear_focus
ensure_hidden
ensure_visible
focus_next_child
focus_previous_child
get_bounding_box
get_transformed_points
get_value_at
has_focus
make_edge
on_shape_changed
parent_shape
request_relayout
restyle
set_alpha1
set_alpha2
set_as_wire
set_axis
set_background
set_clockwise
set_color
set_direction
set_display
set_enabled
set_focus
set_font
set_foreground
set_line_style
set_line_width
set_maximum_size
set_minimum_size
set_points
set_position
set_radius
set_radius2
set_reverse
set_solve
set_status_tip
set_surface
set_texture
set_tool_tip
set_transparency
set_visible
- create_shape()[source]¶
Create the toolkit shape for the proxy object.
This method is called during the top-down pass, just before the ‘init_shape()’ method is called. This method should create the toolkit widget and assign it to the ‘widget’ attribute.
- reference¶
Update the class reference