Forms generating functions

Polygons

Polygon *generate_polygon_radius(uint32_t sides, float radius, Pixel center, float orientation)
Parameters:
  • sides (uint32_t) – The number of sides of the polygon to generate.
  • radius (float) – The radius of the polygon to generate.
  • center (Pixel) – The wants center of the polygon.
  • orientation (float) – An offset in degrees to add to influence the incline of the polygon.
Return type:

Polygon *

Returns:

A regular convex polygon .

note:This result in a regular polygon with sides sides with radius length radius starting at orientation.
see:A blue 12 sides polygon convex.
note:An polygon is convex if all vertex from the polygon are on the same side from every edge of the polygon.

Polygon *generate_corners_rounded_polygon(uint32_t sides, float radius, Pixel center, float orientation)
Parameters:
  • sides (uint32_t) – The number of sides of the polygon to generate.
  • radius (float) – The radius of the polygon to generate.
  • center (Pixel) – The wanted center of the polygon.
  • orientation (float) – An offset in degrees to add to influence the incline of the polygon.
Return type:

Polygon *

Returns:

A polygon which corners are arcs which size is in relationship to the number of sides of the polygon.

see:A blue 12 sides rounded corners polygon.

Note:

The radius goes from the center to the center of the circle arcs: the rounded corners.

Polygon *generate_sides_rounded_polygon(uint32_t sides, float radius, Pixel center, float orientation)
Parameters:
  • sides (uint32_t) – The number of sides of the polygon to generate.
  • radius (float) – The radius of the polygon to generate.
  • center (Pixel) – The wanted center of the polygon.
  • orientation (float) – An offset in degrees to add to influence the incline of the polygon.
Return type:

Polygon *

Returns:

A polygon which sides are rounded according the number of sides of the polygon.

see:A blue 12 sides rounded corners polygon.

Note:

The radius goes from the center to the center of the circle arcs.

Warning

The parameter sides must be conform to:

sides % 2 != 0

I can only generate odd sides numbered sides rounded polygons.

Polygon *generate_rounded_inside_out_polygon(uint32_t sides, float radius, Pixel center, float orientation)
Parameters:
  • sides (uint32_t) – The number of arcs of the polygon to generate.
  • radius (float) – The radius of the polygon to generate.
  • center (Pixel) – The wanted center of the polygon.
  • orientation (float) – An offset in degrees to add to influence the incline of the polygon.
Return type:

Polygon *

Returns:

A polygon alternating inside nad outside arcs the number of sides of the polygon.

see:A blue 12 sides rounded inside out polygon.

Note:

The radius goes from the center to the center of the circle arcs.

Warning

The sides number is multiply per 2 to obtains an even numbered polygon.

Polygon *generate_alternate_inside_half_circle_polygon(uint32_t sides, float radius, Pixel center, float orientation)
Parameters:
  • sides (uint32_t) – The number of sides of the polygon to generate.
  • radius (float) – The radius of the polygon to generate.
  • center (Pixel) – The wanted center of the polygon.
  • orientation (float) – An offset in degrees to add to influence the incline of the polygon.
Return type:

Polygon *

Returns:

A rounded polygon alternating arcs rounded to the outside and to the inside of the polygon.

see:A blue 12 sides alternate inside half circle polygon.

Note:

The radius goes from the center to the center of the circle arcs.

Warning

The result is an even polygon of the double of the sides values.

Polygon *generate_alternate_outside_half_circle_polygon(uint32_t sides, float radius, Pixel center, float orientation, bool side_arcs)
Parameters:
  • sides (uint32_t) – The number of sides of the polygon to generate.
  • radius (float) – The radius of the polygon to generate.
  • center (Pixel) – The wanted center of the polygon.
  • orientation (float) – An offset in degrees to add to influence the incline of the polygon.
  • sides_arcs (bool) – Boolean value determine if the sides which are not half-cirlce arcs should be rounded.
Return type:

Polygon *

Returns:

A polygon with half-circle rounded to the inside from the half sum from the sides of the polygon and the other is even an arc or an straight line according to the side_arcs boolean value.

see:A blue 12 sides alternate outside half circle polygon.

Note:

The radius goes from the center to the center of the circle arcs.

Warning

The result is an even polygon of the double of the sides values.

Stars

Star *generate_star(uint32_t pikes, float radius, Pixel center, float orientation)
Parameters:
  • pikes (uint32_t) – The number of pikes of the star.
  • radius (float) – The radius of the star base polygon not the spike.
  • center (Pixel) – The wants center from the star.
  • orientation (float) – An offset in degrees to add to influence the incline of the star.
Return type:

Star *

Returns:

A star with the number of wants pikes according to the given settings.

note:This function generate a star based on a regular polygon.
see:A blue 24 peaks star.

Note:

The radius value is the radius of the base polygon.

Star *generate_pentagram_star(float radius, Pixel center, float orientation)
Parameters:
  • radius (float) – An base value for the generation of the 5 pikes star.
  • center (Pixel) – The wants center from the 5 pikes star.
  • orientation (float) – An offset in degrees to add to influence the incline of the star.
Return type:

Star *

Returns:

A not a regular 5 pikes star but a pentagram star or pentacle.

note:This function generate a simply 5 extremity star with the particularity that the resulting star is not a regular star but a pentagram star.
see:A blue pentagram star.

Note:

The radius value is the radius of the base polygon.

Star *generate_hexagram_star(float radius, Pixel center, float orientation)
Parameters:
  • radius (float) – An base value for the generation of the 6 pikes star.
  • center (Pixel) – The wants center from the 6 pikes star.
  • orientation (float) – An offset in degrees to add to influence the incline of the star.
Return type:

Star *

Returns:

A not a regular 6 pikes star but a hexagram star or star of David.

note:This function generate a simply 6 extremity star, with the particularity that the resulting star is not a regular star but an hexagram star or star of David.
see:A blue hexagram star.

Note:

The radius value is the radius of the base polygon.

pentagram

Pentagram *generate_pentagram(float radius, Pixel center, float orientation)
Parameters:
  • radius (float) – An base value for the generation of the 5 pikes star.
  • center (Pixel) – The wants center from the 5 pikes star.
  • orientation (float) – An offset in degrees to add to influence the incline of the star.
Return type:

Pentagram *

Returns:

A pentagram or named pentacle.

note:This function generate an 5 extremity star with an centered pentagon from which every vertex go to the center.
see:A blue pentagram.

Note:

The radius value is the radius of the base polygon.

hexagram

Hexagram *generate_hexagram(float radius, Pixel center, float orientation)
Parameters:
  • radius (float) – An base value for the generation of the 6 pikes star.
  • center (Pixel) – The wants center from the 6 pikes star.
  • orientation (float) – An offset in degrees to add to influence the incline of the star.
Return type:

Hexagram *

Returns:

A hexagram.

note:This function generate a 6 extremity star with an centered hexagon from which every vertex go to the center.
see:A blue hexagram.

Note:

The radius value is the radius of the base polygon.

Fractal

Polygon *generate_fractal(uint32_t polygon, float radius, Pixel center, float orientation, bool open)
Parameters:
  • polygon (uint32_t) – Base polygon from the fractal.
  • radius (float) – The radius from the base polygon.
  • center (Pixel) – The wants center from the fractal.
  • orientation (float) – An offset in degrees to add to influence the incline of the fractal.
  • open (bool) – Change the fractal pikes.
Return type:

Polygon *

Returns:

A strange fractal form coming from an crazy brain. :)

Note:

The radius goes from the center to the farest point of the fratcal (so equal to the real_length value) .

Spiral

Spiral *generate_simple_spiral(Pixel center, uint32_t turns, uint32_t base, float offset_exponent, float orientation, bool reverse)
Parameters:
  • center (Pixel) – The center from the spiral.
  • turns (uint32_t) – The number of revolution of the spiral.
  • base (uint32_t) – the base number of points to make one turn (roundness).
  • offset_exponent (float) – The factor to compute the distance between 2 points a turn offset.
  • orientation (float) – An offset in degrees to add to influence the incline of the spiral.
  • reverse (bool) – Reverse the spiral.
Return type:

Spiral *

Returns:

A spiral according to the given settings.

see:A blue rounded 3 turns spiral.

Note:

The radius goes from the center to the end of the first entire revolution of the spiral.

Note

The base and the offset_exponent parameters values will influente of the size of the spiral.

You cannot set an radius but the generating function does it.

note:The value from the base parameter will be divided per two in the resulting spiral.

Warning

The turns parameter value will be multiply per 2 to obtains the number of revolutions of the spiral.

The base parameter will be divided per two in the resulting spiral.

I can only generate even spirals.

Wheels

Polygon *generate_wheel(uint32_t polygon, float radius, Pixel center, float offset, float orientation)
Parameters:
  • polygon (uint32_t) – Number of sides of the wheel (base polygon).
  • radius (float) – The radius of the wheel.
  • center (Pixel) – The center from the wheel.
  • offset (float) – Size of the peaks of the wheel.
Return type:

Polygon *

Returns:

A pointed wheel according to the given settings.

note:The peaks of the wheel are trigons like a star.
see:A blue 24 peaks wheel.

Note:

The radius value is the radius of the base polygon.

Note

You must set an offset value other than 0 because it represent the size of the peaks of the wheel.

The difference betwenn this wheel and a normal star is that is regular.

note:the radius Polygon member from this wheel is the radius of the base polygon from this wheel (interior).

Warning

The parameter polygon have a value conform to:

360 % polygon == 0
Polygon *generate_circular_saw_wheel(uint32_t polygon, float radius, Pixel center, float offset, float orientation, bool reverse)
Parameters:
  • polygon (uint32_t) – Number of sides of the circular saw (base polygon).
  • radius (float) – The radius from the points of the circular saw like wheel.
  • center (Pixel) – The center from the circular saw like wheel.
  • offset (float) – Size of the points.
  • reverse (bool) – Reverse the shift from the circular saw like wheel.
Return type:

Polygon *

Returns:

A circular saw like pointed wheel.

note:This function generate an circular saw like wheel. This is only an polygon with an rectangle triangle on the top of the edges.
see:A blue 24 peaks circular saw.

Note:

The radius goes from the center to the end of the pikes (it’s equal to the real_length value).

Warning

The parameter polygon have a value conform to:

360 % polygon == 0
Polygon *generate_wheel_peaks_trigon(uint32_t sides, float radius, Pixel center, float peak_offset, float orientation)
Parameters:
  • sides (uint32_t) – Number of sides of the base polygon.
  • radius (float) – An base value for generating the wheel (rounded polygon).
  • center (Pixel) – Center from the wheel (rounded polygon).
  • peak_offset (float) – Peak offset.
  • orientation (float) – An offset in degrees to add to influence the incline of the wheel (rounded polygon).
Return type:

Polygon *

Returns:

A pointed wheel (rounded polygon) with peaks implemented as trigon which ends are mini arcs.

note:This function generate an wheel (rounded polygon) with peaking as trigons.
see:A blue 24 trigon peaks wheel.

Note:

The radius value is the radius of the base polygon.

Warning

The parameter polygon have a value conform to:

360 % polygon == 0
Polygon *generate_wheel_peaks_rounded_square(uint32_t sides, float radius, Pixel center, float peak_length, float orientation)
Parameters:
  • sides (uint32_t) – Number of sides from the wheel (rounded polygon).
  • radius (float) – Radius from the wheel (rounded polygon).
  • center (Pixel) – Center from the wheel (rounded polygon).
  • peak_length (float) – Size of the peaks.
  • orientation (float) – An offset in degrees to add to influence the incline of the wheel (rounded polygon).
Return type:

Polygon *

Returns:

A pointed wheel with peaks looking like a tube.

note:This function generate an pointed wheel (rounded polygon) with peaks looking like a tube but they are only right-angled line to the sides and connected trough an arc.
see:A blue 24 rounded square peaks wheel.

Note:

The radius value is the radius of the base polygon.

Warning

The parameter sides have a value conform to:

360 % sides == 0 and sides <= 24

Table Of Contents

Previous topic

Base functions

Next topic

Displaying forms

This Page