drawing_tools.view.geometry package#
Subpackages#
- drawing_tools.view.geometry.relationships package
- Submodules
- drawing_tools.view.geometry.relationships.detector module
- drawing_tools.view.geometry.relationships.graph module
EdgeConstraintGraphEdgeConstraintGraph.__init__()EdgeConstraintGraph.add_edge()EdgeConstraintGraph.add_relationship()EdgeConstraintGraph.has_relationship()EdgeConstraintGraph.get_relationships_between()EdgeConstraintGraph.get_relationship_metadata()EdgeConstraintGraph.count_relationships()EdgeConstraintGraph.get_tangent_relationships()EdgeConstraintGraph.get_tangent_points()EdgeConstraintGraph.are_parallel()EdgeConstraintGraph.are_perpendicular()EdgeConstraintGraph.are_connected()EdgeConstraintGraph.are_tangent()EdgeConstraintGraph.are_concentric()EdgeConstraintGraph.are_symmetric()EdgeConstraintGraph.get_connection_points()EdgeConstraintGraph.get_parallel_offset()EdgeConstraintGraph.get_angular_relationship()EdgeConstraintGraph.get_related_edges()EdgeConstraintGraph.find_edges_by_pattern()EdgeConstraintGraph.find_chains_by_pattern()EdgeConstraintGraph.find_rectangular_connections()EdgeConstraintGraph.find_rectangular_corners()EdgeConstraintGraph.find_rectangular_chains()EdgeConstraintGraph.get_parallel_edges()EdgeConstraintGraph.get_perpendicular_edges()EdgeConstraintGraph.get_perpendicular_connected_edges()EdgeConstraintGraph.get_collinear_edges()EdgeConstraintGraph.get_collinear_connected_edges()EdgeConstraintGraph.get_connected_edges()EdgeConstraintGraph.get_tangent_edges()EdgeConstraintGraph.get_concentric_edges()EdgeConstraintGraph.get_symmetric_edges()EdgeConstraintGraph.get_edges_at_point()EdgeConstraintGraph.find_connected_components()EdgeConstraintGraph.find_parallel_groups()EdgeConstraintGraph.find_chains()EdgeConstraintGraph.get_statistics()EdgeConstraintGraph.print_summary()
- drawing_tools.view.geometry.relationships.point_mapper module
PointToEdgeMapperPointToEdgeMapper.__init__()PointToEdgeMapper.add_edge()PointToEdgeMapper.add_edges()PointToEdgeMapper.from_view()PointToEdgeMapper.remove_edge()PointToEdgeMapper.get_edges_at_point()PointToEdgeMapper.get_edges_at_points()PointToEdgeMapper.find_nearest_point()PointToEdgeMapper.get_all_points()PointToEdgeMapper.get_points_in_region()PointToEdgeMapper.find_canonical_point()PointToEdgeMapper.clear()PointToEdgeMapper.validate_integrity()PointToEdgeMapper.to_networkx()PointToEdgeMapper.plot_data_graph()PointToEdgeMapper.plot_data_edges()PointToEdgeMapper.get_mapping_statistics()PointToEdgeMapper.print_mapping_summary()
- drawing_tools.view.geometry.relationships.types module
SymmetryAxisGeometricRelationTypeGeometricRelationType.COINCIDENTGeometricRelationType.INCIDENTGeometricRelationType.PARALLELGeometricRelationType.PERPENDICULARGeometricRelationType.COLLINEARGeometricRelationType.ANGULARGeometricRelationType.TANGENTGeometricRelationType.CONCENTRICGeometricRelationType.SYMMETRICGeometricRelationType.OFFSETGeometricRelationType.__str__()
CoincidentTypeCoincidentTypeProcessorEdgeRelationship
- Module contents
EdgeConstraintGraphEdgeConstraintGraph.__init__()EdgeConstraintGraph.add_edge()EdgeConstraintGraph.add_relationship()EdgeConstraintGraph.has_relationship()EdgeConstraintGraph.get_relationships_between()EdgeConstraintGraph.get_relationship_metadata()EdgeConstraintGraph.count_relationships()EdgeConstraintGraph.get_tangent_relationships()EdgeConstraintGraph.get_tangent_points()EdgeConstraintGraph.are_parallel()EdgeConstraintGraph.are_perpendicular()EdgeConstraintGraph.are_connected()EdgeConstraintGraph.are_tangent()EdgeConstraintGraph.are_concentric()EdgeConstraintGraph.are_symmetric()EdgeConstraintGraph.get_connection_points()EdgeConstraintGraph.get_parallel_offset()EdgeConstraintGraph.get_angular_relationship()EdgeConstraintGraph.get_related_edges()EdgeConstraintGraph.find_edges_by_pattern()EdgeConstraintGraph.find_chains_by_pattern()EdgeConstraintGraph.find_rectangular_connections()EdgeConstraintGraph.find_rectangular_corners()EdgeConstraintGraph.find_rectangular_chains()EdgeConstraintGraph.get_parallel_edges()EdgeConstraintGraph.get_perpendicular_edges()EdgeConstraintGraph.get_perpendicular_connected_edges()EdgeConstraintGraph.get_collinear_edges()EdgeConstraintGraph.get_collinear_connected_edges()EdgeConstraintGraph.get_connected_edges()EdgeConstraintGraph.get_tangent_edges()EdgeConstraintGraph.get_concentric_edges()EdgeConstraintGraph.get_symmetric_edges()EdgeConstraintGraph.get_edges_at_point()EdgeConstraintGraph.find_connected_components()EdgeConstraintGraph.find_parallel_groups()EdgeConstraintGraph.find_chains()EdgeConstraintGraph.get_statistics()EdgeConstraintGraph.print_summary()
EdgeRelationshipEdgeRelationshipDetectorGeometricRelationTypeGeometricRelationType.COINCIDENTGeometricRelationType.INCIDENTGeometricRelationType.PARALLELGeometricRelationType.PERPENDICULARGeometricRelationType.COLLINEARGeometricRelationType.ANGULARGeometricRelationType.TANGENTGeometricRelationType.CONCENTRICGeometricRelationType.SYMMETRICGeometricRelationType.OFFSETGeometricRelationType.__str__()
PointToEdgeMapperPointToEdgeMapper.__init__()PointToEdgeMapper.add_edge()PointToEdgeMapper.add_edges()PointToEdgeMapper.from_view()PointToEdgeMapper.remove_edge()PointToEdgeMapper.get_edges_at_point()PointToEdgeMapper.get_edges_at_points()PointToEdgeMapper.find_nearest_point()PointToEdgeMapper.get_all_points()PointToEdgeMapper.get_points_in_region()PointToEdgeMapper.find_canonical_point()PointToEdgeMapper.clear()PointToEdgeMapper.validate_integrity()PointToEdgeMapper.to_networkx()PointToEdgeMapper.plot_data_graph()PointToEdgeMapper.plot_data_edges()PointToEdgeMapper.get_mapping_statistics()PointToEdgeMapper.print_mapping_summary()
Submodules#
drawing_tools.view.geometry.rectangles module#
The free-standing rectangles of a view that given points land on: four visible straight segments.
Geometry only – nothing here knows what the points are. A rectangle is found from a segment a point lands on by walking corner to corner: four visible straight segments, each starting where the previous one ends, the fourth ending where the first starts, their directions two perpendicular families. It must then have FREE CORNERS: no other visible straight segment ends at one of them. That is what tells a rectangle standing on its own from one the part’s lines close – a line may cross it, never start from it.
RectangleSegments is the shape every rectangle takes here: its four sides, in walk order.
RECTANGLE_SIDE_COUNT and PERPENDICULAR_SIDE_COUNT state what a rectangle IS rather than
tune the search, hence their staying out of RectangleDetectionConfig.
- class drawing_tools.view.geometry.rectangles.RectangleDetectionConfig(corner_tolerance: float = 0.05, right_angle_cosine_tolerance: float = 0.05)#
Bases:
objectTuning of
detect_rectangles_at_points(), both bounds absolute.- Parameters:
corner_tolerance – How far apart two endpoints still count as one corner, in drawing units – the drawing’s own precision, measured identical anywhere between 0.05 and 0.5.
right_angle_cosine_tolerance – Bound on the dot product between two unit side directions. Read as a cosine, 0.05 bounds a right angle to 3 degrees.
- drawing_tools.view.geometry.rectangles.detect_rectangles_at_points(view: View, points: list[Point2D], max_distance: float, config: RectangleDetectionConfig | None = None) list[RectangleSegments]#
Return the free-standing rectangles of the view one side of which one of
pointslands on.Invisible geometries –
blanked_status1, which the drawing does not show – are neither sides nor lines meeting a corner.- Parameters:
view – The view to search.
points – Where to search from, typically the terminators of the view’s leaders.
max_distance – How far a point may lie from a side, in drawing units.
config – Detection parameters. Uses defaults if not provided.
- Returns:
The four sides of each rectangle, each rectangle once, top-down then left to right. The order is not for reading: it only makes the output deterministic,
Edge.__hash__being randomized per process.
Module contents#
Module specialized on analysis on view’s geometries.