gen_circle_sectorgen_circle_sectorGenCircleSectorGenCircleSectorgen_circle_sector (算子)

名称

gen_circle_sectorgen_circle_sectorGenCircleSectorGenCircleSectorgen_circle_sector — 创建一个圆形扇区。

签名

gen_circle_sector( : CircleSector : Row, Column, Radius, StartAngle, EndAngle : )

Herror gen_circle_sector(Hobject* CircleSector, double Row, double Column, double Radius, double StartAngle, double EndAngle)

Herror T_gen_circle_sector(Hobject* CircleSector, const Htuple Row, const Htuple Column, const Htuple Radius, const Htuple StartAngle, const Htuple EndAngle)

void GenCircleSector(HObject* CircleSector, const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartAngle, const HTuple& EndAngle)

void HRegion::HRegion(const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartAngle, const HTuple& EndAngle)

void HRegion::HRegion(double Row, double Column, double Radius, double StartAngle, double EndAngle)

void HRegion::GenCircleSector(const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartAngle, const HTuple& EndAngle)

void HRegion::GenCircleSector(double Row, double Column, double Radius, double StartAngle, double EndAngle)

static void HOperatorSet.GenCircleSector(out HObject circleSector, HTuple row, HTuple column, HTuple radius, HTuple startAngle, HTuple endAngle)

public HRegion(HTuple row, HTuple column, HTuple radius, HTuple startAngle, HTuple endAngle)

public HRegion(double row, double column, double radius, double startAngle, double endAngle)

void HRegion.GenCircleSector(HTuple row, HTuple column, HTuple radius, HTuple startAngle, HTuple endAngle)

void HRegion.GenCircleSector(double row, double column, double radius, double startAngle, double endAngle)

def gen_circle_sector(row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], radius: MaybeSequence[Union[int, float]], start_angle: MaybeSequence[Union[int, float]], end_angle: MaybeSequence[Union[int, float]]) -> HObject

描述

算子 gen_circle_sectorgen_circle_sectorGenCircleSectorGenCircleSectorGenCircleSectorgen_circle_sector generates one or more circles sectors described by the center, RadiusRadiusRadiusRadiusradiusradius, StartAngleStartAngleStartAngleStartAnglestartAnglestart_angle and EndAngleEndAngleEndAngleEndAngleendAngleend_angle. If several circle sectors shall be generated the coordinates must be passed in the form of tuples.

gen_circle_sectorgen_circle_sectorGenCircleSectorGenCircleSectorGenCircleSectorgen_circle_sector only creates symmetric circle sectors with respect to the center of coordinates. To achieve this, the radius is internally rounded down to a multiple of 0.5. If an integer number is specified for the radius (i.e., 1, 2, 3, ...) an even diameter is obtained, and hence the circle can only be symmetric with respect to a center with coordinates that have a fractional part of 0.5. Consequently, internally the coordinates of the center are adapted to the closest coordinates that have a fractional part of 0.5. Here, integer coordinates are rounded down to the next smaller values with a fractional part of 0.5. For odd diameters (i.e., radius = 1.5, 2.5, 3.5, ...), the circle can only be symmetric with respect to a center with integer coordinates. Hence, internally the coordinates of the center are rounded to the nearest integer coordinates. It should be noted that the above algorithm may lead to the fact that circles with an even diameter are not contained in circles with the next larger odd diameter, even if the coordinates specified in RowRowRowRowrowrow and ColumnColumnColumnColumncolumncolumn are identical. The angles are given in radians in mathematically positive direction. See the examples illustrated in the figure below. Note, 'rad(360)'"rad(360)""rad(360)""rad(360)""rad(360)""rad(360)" is equivalent to 0. As a consequence a sector with StartAngleStartAngleStartAngleStartAnglestartAnglestart_angle = 0 and EndAngleEndAngleEndAngleEndAngleendAngleend_angle = 'rad(360)'"rad(360)""rad(360)""rad(360)""rad(360)""rad(360)" results in an empty region.

Illustration of different possible angle combinations.

If the circle extends beyond the image edge it is clipped to the current image format if the value of the system flag 'clip_region'"clip_region""clip_region""clip_region""clip_region""clip_region" is set to 'true'"true""true""true""true""true" (set_systemset_systemSetSystemSetSystemSetSystemset_system).

执行信息

参数

CircleSectorCircleSectorCircleSectorCircleSectorcircleSectorcircle_sector (输出对象)  region(-array) objectHRegionHObjectHRegionHobject *

Generated circle sector.

RowRowRowRowrowrow (输入控制)  coordinates.y(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Line index of center.

默认值: 200.0

建议值: 0.0, 10.0, 50.0, 100.0, 200.0, 300.0

值范围: 1.0 ≤ Row Row Row Row row row ≤ 1024.0 (lin)

最小增量: 1.0

建议增量: 10.0

ColumnColumnColumnColumncolumncolumn (输入控制)  coordinates.x(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Column index of center.

默认值: 200.0

建议值: 0.0, 10.0, 50.0, 100.0, 200.0, 300.0

值范围: 1.0 ≤ Column Column Column Column column column ≤ 1024.0 (lin)

最小增量: 1.0

建议增量: 10.0

RadiusRadiusRadiusRadiusradiusradius (输入控制)  number(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Radius of circle.

默认值: 100.5

建议值: 1.0, 1.5, 2.0, 2.5, 3, 3.5, 4, 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 15.5, 20.5, 25.5, 31.5, 50.5

值范围: Radius Radius Radius Radius radius radius (lin)

最小增量: 1.0

建议增量: 10.0

限制: Radius > 0.0

StartAngleStartAngleStartAngleStartAnglestartAnglestart_angle (输入控制)  angle.rad(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Start angle of the circle sector.

默认值: 0.0

建议值: 0.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318

值范围: 0 ≤ StartAngle StartAngle StartAngle StartAngle startAngle start_angle ≤ 6.28318 (lin)

EndAngleEndAngleEndAngleEndAngleendAngleend_angle (输入控制)  angle.rad(-array) HTupleMaybeSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

End angle of the circle sector.

默认值: 3.14159

建议值: 0.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318

值范围: 0 ≤ EndAngle EndAngle EndAngle EndAngle endAngle end_angle ≤ 6.28318 (lin)

示例(HDevelop)

read_image(Image,'fabrik')
gen_circle_sector(CircleSector,300.0,200.0,150.5,0,rad(120))
reduce_domain(Image,CircleSector,Mask)
dev_clear_window ()
dev_display (Mask)

复杂度

Runtime complexity: O(RadiusRadiusRadiusRadiusradiusradius * 2)

Storage complexity (byte): O(RadiusRadiusRadiusRadiusradiusradius * 8)

结果

如果参数值正确,算子 gen_circle_sectorgen_circle_sectorGenCircleSectorGenCircleSectorGenCircleSectorgen_circle_sector 返回值 2 ( H_MSG_TRUE )。否则将抛出异常。 The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>)set_system("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)SetSystem("clip_region",<"true"/"false">)set_system("clip_region",<"true"/"false">)。If an empty region is created by clipping (the circle is completely outside of the image format) the operator set_system('store_empty_region',<'true'/'false'>)set_system("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)SetSystem("store_empty_region",<"true"/"false">)set_system("store_empty_region",<"true"/"false">) determines whether the empty region is put out.

可能的后继

paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain

替代

gen_ellipsegen_ellipseGenEllipseGenEllipseGenEllipsegen_ellipse, gen_ellipse_sectorgen_ellipse_sectorGenEllipseSectorGenEllipseSectorGenEllipseSectorgen_ellipse_sector, gen_region_polygon_filledgen_region_polygon_filledGenRegionPolygonFilledGenRegionPolygonFilledGenRegionPolygonFilledgen_region_polygon_filled, gen_region_pointsgen_region_pointsGenRegionPointsGenRegionPointsGenRegionPointsgen_region_points, gen_region_runsgen_region_runsGenRegionRunsGenRegionRunsGenRegionRunsgen_region_runs, draw_circledraw_circleDrawCircleDrawCircleDrawCircledraw_circle

另见

disp_circledisp_circleDispCircleDispCircleDispCircledisp_circle, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region, set_shapeset_shapeSetShapeSetShapeSetShapeset_shape, smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCirclesmallest_circle, reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain

模块

基础