extend_entity#

RegionMagnet.extend_entity(entity_index, distance=None, fraction=None, factor=None, extend_from_end=True)#

Extend an Entity of a Region by a given distance.

The Entity will be extended by keeping the start point fixed and shifting the end point unless extend_from_end is False. If extend_from_end is False, the end point will be kept fixed and the start point will be shifted instead. Tip: to extend from both ends, you can use the method twice.

Parameters:
entity_indexint

Index of the Region Entity that is to be extended.

distancefloat

Absolute distance to extend the Entity by. If negative, the Entity will be shortened.

fractionfloat

Fractional distance to extend the Entity by. If negative, the Entity will be shortened.

factorfloat

Factor to extend the Entity length to. The new Entity length will be the original length multiplied by the factor. If less than 1, the Entity will be shortened.

extend_from_endbool

If True, start point is unchanged and end point is shifted. If False, end point is unchanged and start point is fixed.