ZLayout EDA Library v1.0.0
Advanced Electronic Design Automation Layout Library with Bilingual Documentation
Loading...
Searching...
No Matches
zlayout::geometry Namespace Reference

Classes

class  Point
 2D point with high-precision coordinates and utility methods More...
struct  PointHash
 Hash function for Point (for use in std::unordered_map, etc.) More...
class  Polygon
 Polygon class supporting both convex and concave polygons. More...
struct  PolygonHash
 Hash function for Polygon (for use in std::unordered_map, etc.) More...
class  Rectangle
 Axis-aligned rectangle for bounding boxes and simple EDA components. More...
struct  RectangleHash
 Hash function for Rectangle (for use in std::unordered_map, etc.) More...

Functions

double distance (const Point &p1, const Point &p2)
 Calculate distance between two points.
Point midpoint (const Point &p1, const Point &p2)
 Calculate midpoint between two points.
double angle_between_points (const Point &p1, const Point &p2, const Point &p3)
 Calculate angle between three points (p1-p2-p3)
bool are_collinear (const Point &p1, const Point &p2, const Point &p3)
 Check if three points are collinear.
int orientation (const Point &p1, const Point &p2, const Point &p3)
 Calculate orientation of three points.
bool line_intersection (const Point &line1_start, const Point &line1_end, const Point &line2_start, const Point &line2_end, Point &intersection)
 Calculate intersection point of two infinite lines.
bool segments_intersect (const Point &seg1_start, const Point &seg1_end, const Point &seg2_start, const Point &seg2_end)
 Check if two line segments intersect.
double angle_between_vectors (const Point &v1, const Point &v2)
 Calculate angle between two vectors in degrees.
std::ostream & operator<< (std::ostream &os, const Point &point)
std::ostream & operator<< (std::ostream &os, const Polygon &polygon)
std::ostream & operator<< (std::ostream &os, const Rectangle &rect)

Variables

bool HAS_NUMPY = True

Detailed Description

Basic geometric data structures for layout processing.

Function Documentation

◆ angle_between_points()

double zlayout::geometry::angle_between_points ( const Point & p1,
const Point & p2,
const Point & p3 )

Calculate angle between three points (p1-p2-p3)

Parameters
p1First point
p2Vertex point
p3Third point
Returns
Angle in radians

Definition at line 169 of file point.cpp.

Here is the call graph for this function:

◆ angle_between_vectors()

double zlayout::geometry::angle_between_vectors ( const Point & v1,
const Point & v2 )

Calculate angle between two vectors in degrees.

Parameters
v1First vector
v2Second vector
Returns
Angle in degrees (0-180)

Definition at line 473 of file polygon.cpp.

◆ are_collinear()

bool zlayout::geometry::are_collinear ( const Point & p1,
const Point & p2,
const Point & p3 )

Check if three points are collinear.

Parameters
p1First point
p2Second point
p3Third point
Returns
true if points are collinear within tolerance

Definition at line 190 of file point.cpp.

Here is the call graph for this function:

◆ distance()

double zlayout::geometry::distance ( const Point & p1,
const Point & p2 )

Calculate distance between two points.

Parameters
p1First point
p2Second point
Returns
Distance between points

Definition at line 161 of file point.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ line_intersection()

bool zlayout::geometry::line_intersection ( const Point & line1_start,
const Point & line1_end,
const Point & line2_start,
const Point & line2_end,
Point & intersection )

Calculate intersection point of two infinite lines.

Parameters
line1_startFirst point on line 1
line1_endSecond point on line 1
line2_startFirst point on line 2
line2_endSecond point on line 2
intersectionOutput intersection point
Returns
true if lines intersect (not parallel)

◆ midpoint()

Point zlayout::geometry::midpoint ( const Point & p1,
const Point & p2 )

Calculate midpoint between two points.

Parameters
p1First point
p2Second point
Returns
Midpoint

Definition at line 165 of file point.cpp.

◆ operator<<() [1/3]

std::ostream & zlayout::geometry::operator<< ( std::ostream & os,
const Point & point )

Definition at line 144 of file point.cpp.

◆ operator<<() [2/3]

std::ostream & zlayout::geometry::operator<< ( std::ostream & os,
const Polygon & polygon )

Definition at line 406 of file polygon.cpp.

◆ operator<<() [3/3]

std::ostream & zlayout::geometry::operator<< ( std::ostream & os,
const Rectangle & rect )

Definition at line 210 of file rectangle.cpp.

◆ orientation()

int zlayout::geometry::orientation ( const Point & p1,
const Point & p2,
const Point & p3 )

Calculate orientation of three points.

Parameters
p1First point
p2Second point
p3Third point
Returns
0 if collinear, 1 if clockwise, 2 if counterclockwise

Definition at line 198 of file point.cpp.

Here is the call graph for this function:

◆ segments_intersect()

bool zlayout::geometry::segments_intersect ( const Point & seg1_start,
const Point & seg1_end,
const Point & seg2_start,
const Point & seg2_end )

Check if two line segments intersect.

Parameters
seg1_startStart of first segment
seg1_endEnd of first segment
seg2_startStart of second segment
seg2_endEnd of second segment
Returns
true if segments intersect

Definition at line 468 of file polygon.cpp.

Here is the call graph for this function:

Variable Documentation

◆ HAS_NUMPY

bool zlayout.geometry.HAS_NUMPY = True

Definition at line 11 of file geometry.py.