rayoptics.parax.diagram module
- class Diagram(opt_model, parax_model, parax_model_key, dgm_type, seq_start=1, do_barrel_constraint=False, barrel_constraint=1.0, label='paraxial', bend_or_gap='bend', do_node_annotation=False, is_dark=True)[source]
Bases:
object
class for paraxial ray rendering/editing
- compute_slide_line(shape, node, imode)[source]
compute a constraint line to keep the overall length of the airspaces surrounding node constant
- class EditNodeAction(dgm_node: DiagramNode, filter=None, constrain_to_wedge=True)[source]
Bases:
object
Action to move a diagram node, using an input pt
- class EditLensAction(dgm_edge: DiagramEdge)[source]
Bases:
object
Action for diagram edge, using an input pt
This is a simple wrapper class to choose the correct action, i.e. bending or thickness change, depending on the UI setting.
- class EditAreaAction(dgm_edge: DiagramEdge)[source]
Bases:
object
Action for diagram area, placeholder for now
This is a simple wrapper class to choose the correct action, i.e. bending or thickness change, depending on the UI setting.
- class EditThicknessAction(dgm_edge: DiagramEdge)[source]
Bases:
object
Action to move a diagram edge, using an input pt
The movement is constrained to be parallel to the original edge. By doing this the power and bending of the element remains constant, while the element thickness changes. Movement of the edge is limited to keep the thickness greater than zero and not to interfere with adjacent spaces.
- class EditBendingAction(dgm_edge: DiagramEdge)[source]
Bases:
object
Action to bend the lens element for diagram edge, using an input pt.
The movement is constrained to be along the object ray for the lens if the input point is closer to the leading node of the edge. Otherwise the movement is constrained to be along the image ray. The unconstrained point is solved to keep the element thickness constant and maintain the object-image properties of the lens.
- class AddReplaceElementAction(diagram, **kwargs)[source]
Bases:
object
insert or replace a node with a chunk from a factory fct
The do_command_action fct registered for this operation passes the shape being operated upon; these can be:
DiagramEdge: insert/add the chunk returned by the factory fct
DiagramNode: replace the selected node with the factory fct output
Inserting is done by splitting the corresponding gap in two. A new gap and an AirGap element are tacked on to the chunk returned from the factory fct. Replacing is done when a DiagramNode is selected. The gaps surrounding the node are retained, and modified as needed to accomodate the chunk.
- class AddElementAction(dgm_edge: DiagramEdge, **kwargs)[source]
Bases:
object
insert or replace a node with a chunk from a factory fct
The do_command_action fct registered for this operation passes the shape being operated upon; these can be:
DiagramEdge: insert/add the chunk returned by the factory fct
DiagramNode: replace the selected node with the factory fct output
Inserting is done by splitting the corresponding gap in two. A new gap and an AirGap element are tacked on to the chunk returned from the factory fct. Replacing is done when a DiagramNode is selected. The gaps surrounding the node are retained, and modified as needed to accomodate the chunk.
- class ReplaceElementAction(dgm_node: DiagramNode, **kwargs)[source]
Bases:
object
insert or replace a node with a chunk from a factory fct
The do_command_action fct registered for this operation passes the shape being operated upon; these can be:
DiagramEdge: insert/add the chunk returned by the factory fct
DiagramNode: replace the selected node with the factory fct output
Inserting is done by splitting the corresponding gap in two. A new gap and an AirGap element are tacked on to the chunk returned from the factory fct. Replacing is done when a DiagramNode is selected. The gaps surrounding the node are retained, and modified as needed to accomodate the chunk.
- add_shape(point_filter=None, constrain_to_wedge=True, **inputs)[source]
Graphical input of a 2d polyline
return list of action_desc, action_handle, action