geometor.model.chains¶
Provides the Chain class for analyzing connected golden sections.
This module defines the Chain class, which facilitates the study of sequences of connected geometric sections. It offers tools for extracting segments and points, analyzing the flow of segment lengths, and exploring symmetries within the structure.
Classes¶
A class representing a chain of connected golden sections. |
Module Contents¶
- class geometor.model.chains.Chain(sections: list[geometor.model.sections.Section])¶
A class representing a chain of connected golden sections.
The Chain class is designed to analyze the progression and properties of connected geometric sections. It characterizes the “flow” of the chain by comparing consecutive segment lengths and provides methods to extract segments, points, and symbolic lengths, as well as to identify lines of symmetry.
- sections¶
- segments = []¶
- points = []¶
- extract_segments() list[sympy.geometry.Segment]¶
Extract unique segments from the chain.
This method iterates through all sections in the chain and collects every unique segment involved. It ensures that no duplicate segments are stored in the chain’s segment list.
- Returns:
A list containing the unique segments in the chain.
- extract_points() list[sympy.geometry.Point]¶
Extract unique points from the chain while maintaining order.
This method compiles a list of all unique points used to define the sections in the chain. The order of appearance is preserved to maintain the geometric flow of the chain.
- Returns:
A list containing the ordered unique points from the chain.
- property lengths: list[sympy.Expr]¶
Extract the symbolic lengths of the segments in the chain.
This property returns the lengths of all segments in the chain as symbolic expressions, ensuring exact mathematical representation.
- Returns:
A list containing the symbolic lengths of each segment in the chain.
- property numerical_lengths: list[float]¶
Calculate and extract the numerical lengths of the segments in the chain.
This property evaluates the symbolic lengths of the segments to floating-point numbers. It is useful for numerical analysis and comparisons where symbolic exactness is not required.
- Returns:
A list containing the evaluated numerical lengths of each segment in the chain.
- property flow: list[str]¶
Determine the flow of the segments in the chain by comparing the lengths of consecutive segments.
This property analyzes the relative lengths of adjacent segments to produce a string representation of the chain’s “flow” (e.g., using ‘<’ and ‘>’). This visualization helps in understanding the growth or shrinkage patterns within the chain.
- Returns:
A list of symbols representing the flow of segment lengths. ‘>’ indicates that the previous segment is longer, ‘<’ indicates that the next segment is longer.
- property fibonacci_IDs: list[str]¶
Creates and returns Fibonacci-style IDs for each segment based on their lengths.
This property generates symbolic identifiers (like ‘a’, ‘b’, ‘a+b’) for segments, mirroring the additive properties of Fibonacci sequences. It is particularly relevant when analyzing chains constructed with golden ratio proportions.
- Returns:
A list of strings where each string is a Fibonacci-style ID corresponding to a segment.