Skip to content

gen_ellipse_sectorGenEllipseSectorGenEllipseSectorgen_ellipse_sectorgen_ellipse_sector🔗

Short description🔗

gen_ellipse_sectorGenEllipseSectorGenEllipseSectorgen_ellipse_sectorgen_ellipse_sector — Create an ellipse sector.

Signature🔗

gen_ellipse_sector( out region EllipseSector, coordinates.y Row, coordinates.x Column, angle.rad Phi, number Radius1, number Radius2, angle.rad StartAngle, angle.rad EndAngle )void GenEllipseSector( HObject* EllipseSector, const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2, const HTuple& StartAngle, const HTuple& EndAngle )static void HOperatorSet.GenEllipseSector( out HObject ellipseSector, HTuple row, HTuple column, HTuple phi, HTuple radius1, HTuple radius2, HTuple startAngle, HTuple endAngle )def gen_ellipse_sector( row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], phi: MaybeSequence[Union[int, float]], radius_1: MaybeSequence[Union[int, float]], radius_2: MaybeSequence[Union[int, float]], start_angle: MaybeSequence[Union[int, float]], end_angle: MaybeSequence[Union[int, float]] ) -> HObject

Herror gen_ellipse_sector( Hobject* EllipseSector, double Row, double Column, double Phi, double Radius1, double Radius2, double StartAngle, double EndAngle )

Herror T_gen_ellipse_sector( Hobject* EllipseSector, const Htuple Row, const Htuple Column, const Htuple Phi, const Htuple Radius1, const Htuple Radius2, const Htuple StartAngle, const Htuple EndAngle )

void HRegion::HRegion( const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2, const HTuple& StartAngle, const HTuple& EndAngle )

void HRegion::HRegion( double Row, double Column, double Phi, double Radius1, double Radius2, double StartAngle, double EndAngle )

public HRegion( HTuple row, HTuple column, HTuple phi, HTuple radius1, HTuple radius2, HTuple startAngle, HTuple endAngle )

public HRegion( double row, double column, double phi, double radius1, double radius2, double startAngle, double endAngle )

void HRegion::GenEllipseSector( const HTuple& Row, const HTuple& Column, const HTuple& Phi, const HTuple& Radius1, const HTuple& Radius2, const HTuple& StartAngle, const HTuple& EndAngle )

void HRegion::GenEllipseSector( double Row, double Column, double Phi, double Radius1, double Radius2, double StartAngle, double EndAngle )

void HRegion.GenEllipseSector( HTuple row, HTuple column, HTuple phi, HTuple radius1, HTuple radius2, HTuple startAngle, HTuple endAngle )

void HRegion.GenEllipseSector( double row, double column, double phi, double radius1, double radius2, double startAngle, double endAngle )

Description🔗

The operator gen_ellipse_sectorGenEllipseSector generates one or more ellipse sectors with the center (Rowrowrow, Columncolumncolumn), the orientation Phiphiphi, the half-radii Radius1radius1radius_1 and Radius2radius2radius_2, and the start and end angles StartAnglestartAnglestart_angle and EndAngleendAngleend_angle. The angles are given in radians in mathematically positive direction. An illustration showing this can be found in the reference of gen_circle_sectorGenCircleSector. Note, 'rad(360)'"rad(360)" is equivalent to 00. As a consequence a sector with StartAnglestartAnglestart_angle = 00 and EndAngleendAngleend_angle = 'rad(360)'"rad(360)" results in an empty region. More than one region can be created by passing tuples of parameter values.

The center must be located within the image coordinates. The coordinate system runs from (0,0) (upper left corner) to (Width-1,Height-1). See get_systemGetSystem and reset_obj_dbResetObjDb in this context. If the ellipse reaches beyond the edge of the image it is clipped to the current image format according to the value of the system flag 'clip_region'"clip_region" (set_systemSetSystem).

Parameter Broadcasting🔗

This operator supports parameter broadcasting. This means that each parameter can be given as a tuple of length 1 or N. Parameters with tuple length 1 will be repeated internally such that the number of created items is always N.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

EllipseSectorellipseSectorellipse_sector (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Created ellipse(s).

Rowrowrow (input_control) coordinates.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Line index of center.

Default: 200.0200.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.00.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Row (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Columncolumncolumn (input_control) coordinates.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Column index of center.

Default: 200.0200.0
Suggested values: 0.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.00.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Column (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Phiphiphi (input_control) angle.rad(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Orientation of the longer radius (Radius1).

Default: 0.00.0
Suggested values: -1.5707, -1.1781, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.1781, 1.5707-1.5707, -1.1781, -0.785398, -0.392699, 0.0, 0.392699, 0.785398, 1.1781, 1.5707
Value range: -1.570796 ≤ Phi ≤ 1.570796 (lin)
Restriction: -pi/2 <= Phi <= pi/2

Radius1radius1radius_1 (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Longer radius.

Default: 100.0100.0
Suggested values: 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.02.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Radius1 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Radius1 > 0

Radius2radius2radius_2 (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Shorter radius.

Default: 60.060.0
Suggested values: 1.0, 2.0, 4.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.01.0, 2.0, 4.0, 5.0, 10.0, 20.0, 50.0, 100.0, 256.0, 300.0, 400.0
Value range: Radius2 (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Radius2 > 0

StartAnglestartAnglestart_angle (input_control) angle.rad(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Start angle of the sector.

Default: 0.00.0
Suggested values: 0.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.283180.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318
Value range: 0 ≤ StartAngle ≤ 6.28318 (lin)

EndAngleendAngleend_angle (input_control) angle.rad(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

End angle of the sector.

Default: 3.141593.14159
Suggested values: 0.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.283180.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318
Value range: 0 ≤ EndAngle ≤ 6.28318 (lin)

Example🔗

(HDevelop)


read_image (Image, 'fabrik')
gen_ellipse_sector (EllipseSector, 200, 200, rad(30),\
                     150, 90, rad(45), rad(280))
reduce_domain (Image, EllipseSector, ImageReduced)
dev_clear_window ()
dev_display (ImageReduced)

Complexity🔗

Runtime complexity: \(O(\textrm{Radius1} * 2)\)

Storage complexity (byte): \(O(\textrm{Radius1} * 8)\)

Result🔗

If the parameter values are correct, the operator gen_ellipseGenEllipse returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised. The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>).

Combinations with other operators🔗

Combinations

Possible successors

paint_regionPaintRegion, reduce_domainReduceDomain

Alternatives

gen_circleGenCircle, gen_circle_sectorGenCircleSector, gen_region_polygon_filledGenRegionPolygonFilled, draw_ellipseDrawEllipse, gen_ellipseGenEllipse

See also

disp_ellipseDispEllipse, set_shapeSetShape, smallest_circleSmallestCircle, reduce_domainReduceDomain

Module🔗

Foundation