harmonic ranges

Divine identifies harmonic ranges, which are sets of four collinear points in a specific cross-ratio relationship.

Analysis of harmonic ranges in geometric lines.

This module provides functions to identify and analyze harmonic ranges within lines and segments of the model.

geometor.divine.golden.ranges.check_range(r: tuple[Point, ...]) Expr

Check if a range of 4 points forms a harmonic range.

Parameters:

r – A tuple of 4 points.

Returns:

The cross ratio value (0 if harmonic).

Return type:

sp.Expr

geometor.divine.golden.ranges.analyze_harmonics(line: Line) list[tuple[Point, ...]]

Analyze a line for harmonic ranges.

Parameters:

line – The line to analyze.

Returns:

A list of harmonic ranges (tuples of 4 points).

Return type:

list

geometor.divine.golden.ranges.analyze_harmonics_by_segment(sections_by_line: dict) dict

Group harmonic ranges by segment.

Parameters:

sections_by_line – Dictionary of sections by line.

Returns:

Nested dictionary mapping lines to segments to harmonic ranges.

Return type:

dict