Basic Shapes

IPKISS shapes are all subclasses of the basic Shape class. Currently, most shape primitives are part of the IPKISS (2.4) ipkiss library, but they are also available when using ipkiss3.

ipkiss.geometry.shapes.basic.Shape([points, …]) Basic shape
ipkiss.geometry.shapes.basic.ShapeCircle(…) circle
ipkiss.geometry.shapes.basic.ShapeArc(**kwargs) circular arc
ipkiss.geometry.shapes.basic.ShapeBend(**kwargs) bend: circular arc but specified by its starting point instead of center
ipkiss.geometry.shapes.basic.ShapeCross(**kwargs) cross.
ipkiss.geometry.shapes.basic.ShapeEllipse(…) ellipse
ipkiss.geometry.shapes.basic.ShapeEllipseArc(…) Ellipse arc around a given center.
ipkiss.geometry.shapes.basic.ShapeRectangle(…) rectangle
ipkiss.geometry.shapes.basic.ShapeRoundedRectangle(…) rectangle with rounded corners
ipkiss.geometry.shapes.basic.ShapeRingSegment(…) ring segment
ipkiss.geometry.shapes.basic.ShapeHexagon(…) hexagon
ipkiss.geometry.shapes.basic.ShapeRegularPolygon(…) regular N-sided polygon
ipkiss.geometry.shapes.basic.ShapeParabolic(…) parabolic wedge (taper)

Shape

class ipkiss.geometry.shapes.basic.Shape(points=[], closed=None, **kwargs)

Basic shape

Parameters:

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

import ipkiss3.all as i3
import matplotlib.pyplot as plt

s1 = i3.Shape([(5.0, -5.0), (0.0, 0.0), (5.0, 5.0), (10.0, 0.0)], closed=False)
p2 = i3.Coord2((15.0, 0.0))

s2 = s1 + p2

plt.figure()
plt.plot(s2.x_coords(), s2.y_coords(), 'bo-', markersize=8, linewidth=2)
plt.show()
../../../_images/shapes-1.png

ShapeCircle

class ipkiss.geometry.shapes.basic.ShapeCircle(**kwargs)

circle

Parameters:

box_size: optional

radius: float and number > 0, optional

radius of the circular arc

end_angle: optional

start_angle: optional

angle_step: float, optional

discretization angle

center: Coord2, optional

center of the ellipse

clockwise: optional

orientation of the arc. clockwise:True

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-2.png

ShapeArc

class ipkiss.geometry.shapes.basic.ShapeArc(**kwargs)

circular arc

Parameters:

box_size: optional

radius: float and number > 0, optional

radius of the circular arc

angle_step: float, optional

discretization angle

center: Coord2, optional

center of the ellipse

clockwise: optional

orientation of the arc. clockwise:True

end_angle: float, optional

end angle of the arc according to the parametric representation of an ellipse

start_angle: float, optional

start angle of the arc according to the parametric representation of an ellipse

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-3.png

ShapeBend

class ipkiss.geometry.shapes.basic.ShapeBend(**kwargs)

bend: circular arc but specified by its starting point instead of center

Parameters:

center: optional

end_angle: optional

input_angle: float, optional

output_angle: float, optional

start_angle: optional

start_point: Coord2, optional

starting point of the circular bend

box_size: optional

radius: float and number > 0, optional

radius of the circular arc

angle_step: float, optional

discretization angle

clockwise: optional

orientation of the arc. clockwise:True

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-4.png

ShapeCross

class ipkiss.geometry.shapes.basic.ShapeCross(**kwargs)

cross. thickness sets the width of the arms

Parameters:

box_size: float and number > 0, optional

center: Coord2, optional

thickness: float and number > 0, optional

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-5.png

ShapeEllipse

class ipkiss.geometry.shapes.basic.ShapeEllipse(**kwargs)

ellipse

Parameters:

end_angle: optional

start_angle: optional

angle_step: float, optional

discretization angle

box_size: Coord2, optional

size of the ellipse along major and minor axis

center: Coord2, optional

center of the ellipse

clockwise: optional

orientation of the arc. clockwise:True

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-6.png

ShapeEllipseArc

class ipkiss.geometry.shapes.basic.ShapeEllipseArc(**kwargs)

Ellipse arc around a given center.

ShapeEllipseArc implements the standard parametric representation of an ellipse (x = a * cos(t), y = b * sin(t)) and (0 <= t < 2 * pi), where parameter t is not the actual angle, but has a geometric meaning due to Philippe de La Hire.

The start_angle and end_angle are described as this parameter t.

Parameters:

angle_step: float, optional

discretization angle

box_size: Coord2, optional

size of the ellipse along major and minor axis

center: Coord2, optional

center of the ellipse

clockwise: optional

orientation of the arc. clockwise:True

end_angle: float, optional

end angle of the arc according to the parametric representation of an ellipse

start_angle: float, optional

start angle of the arc according to the parametric representation of an ellipse

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Notes

If you want to get the parametric angle t from the actual angle alpha, you can use the following:

import numpy as np
a, b = box_size
t = np.arctan2(2. / b * np.sin(alpha), 2. / a * np.cos(alpha))  # t and alpha in radians

Examples

../../../_images/shapes-7.png

ShapeRectangle

class ipkiss.geometry.shapes.basic.ShapeRectangle(**kwargs)

rectangle

Parameters:

radius: optional

angle_step: float, optional

angle_step using in the rounding.

box_size: Coord2, optional

size of the rectangle.

center: Coord2, optional

center of the rectangle.

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-8.png

ShaperoundedRectangle

class ipkiss.geometry.shapes.basic.ShapeRoundedRectangle(**kwargs)

rectangle with rounded corners

Parameters:

angle_step: float, optional

angle_step using in the rounding.

box_size: Coord2, optional

size of the rectangle.

center: Coord2, optional

center of the rectangle.

radius: float and Real, number and number >= 0, optional

radius of the rounding used.

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-9.png

ShaperingSegment

class ipkiss.geometry.shapes.basic.ShapeRingSegment(**kwargs)

ring segment

Parameters:

inner_radius: float and number > 0, required

outer_radius: float and number > 0, required

angle_end: float, optional

angle_start: float, optional

angle_step: float, optional

center: Coord2, optional

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-10.png

ShapeHexagon

class ipkiss.geometry.shapes.basic.ShapeHexagon(**kwargs)

hexagon

Parameters:

center: Coord2, optional

Center of the polygon

radius: float and number > 0, optional

Radius of the polygon

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

n_o_sides: int and [3,None], locked

Number of sides of the hexagon

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-11.png

ShapeRegularPolygon

class ipkiss.geometry.shapes.basic.ShapeRegularPolygon(**kwargs)

regular N-sided polygon

Parameters:

center: Coord2, optional

Center of the polygon

n_o_sides: int and [3,None], optional

Number of sides fo the polygon

radius: float and number > 0, optional

Radius of the polygon

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-12.png

ShapeParabolic

class ipkiss.geometry.shapes.basic.ShapeParabolic(**kwargs)

parabolic wedge (taper)

Parameters:

begin_coord: Coord2, optional

begin_width: float and Real, number and number >= 0, optional

end_coord: Coord2, optional

end_width: float and Real, number and number >= 0, optional

width_step: float and number > 0, optional

closed: optional

end_face_angle: optional

Use this to overrule the ‘dangling’ angle at the end of an open shape

points: optional

points of this shape

start_face_angle: optional

Use this to overrule the ‘dangling’ angle at the start of an open shape

size_info: SizeInfo, locked

get the size information on this Shape

Examples

../../../_images/shapes-13.png