Conversions

discopygal.geometry_utils.conversions.FT_to_float(f)

Convert CGAL Field Type (FT) to python float

Parameters:

f (FT) – float to convert

Returns:

python float

Return type:

float

discopygal.geometry_utils.conversions.Point_2_list_to_Point_d(point_2_list)

Convert a list of Point_2’s to a high-dimensional Point_d

Parameters:

point_2_list (list<Point_2>) – list of Point_2’s

Returns:

high dimensional point

Return type:

Point_d

discopygal.geometry_utils.conversions.Point_2_to_xy(point)

Convert CGAL Point_2 to (x,y) values

Parameters:

point (Point_2) – point to convert

Returns:

x, y values of point

Return type:

(float, float)

discopygal.geometry_utils.conversions.Point_d_to_Point_2_list(point_d)
Convert a high-dimensional Point_d to a list of Point_2’s
(We assume that d%2==0)
Parameters:

point_d (Point_d) – point to convert

Returns:

list of Point_2’s

Type:

list<Point_2>

discopygal.geometry_utils.conversions.Polygon_2_to_array_of_points(poly)

Convert a CGAL Polygon_2 to list of points

Parameters:

poly (Polygon_2) – polygon to convert

Returns:

list of tuples of (x,y) points

Return type:

list<(float, float)>

discopygal.geometry_utils.conversions.array_of_points_to_Polygon_2(poly)

Convert a list of points to a CGAL Polygon_2

Parameters:

poly (list<(float, :class:`float)>) – list of points to convert

Returns:

CGAL polygon

Return type:

:class:~discopygal.bindings.Polygon_2`

discopygal.geometry_utils.conversions.float_to_FT(f)

Convert python float value to CGAL Field Type (FT)

Parameters:

f (float) – float to convert

Returns:

CGAL FT

Return type:

FT

discopygal.geometry_utils.conversions.xy_to_Point_2(x, y)

Convert (x,y) values to CGAL Point_2

Parameters:
  • x (float) – x value

  • y (float) – y value

Returns:

CGAL Point_2 point from (x,y)

Return type:

Point_2