TreeRegion#

class ansys.motorcad.core.geometry_tree.TreeRegion(tree, region_type, motorcad_instance=None)#

Subclass of Region used for entries in GeometryTree.

Nodes should not have a parent or children unless they are part of a tree.

Methods

TreeRegion.add_entity(entity)

Add entity to list of region entities.

TreeRegion.add_point(point)

Add a new point into region on an existing Line/Arc.

TreeRegion.collides(regions)

Check whether any of the specified regions collide with self.

TreeRegion.edit_point(old_coordinates, ...)

Edit a point in the region and update entities.

TreeRegion.extend_entity(entity_index[, ...])

Extend an Entity of a Region by a given distance.

TreeRegion.find_entity_from_coordinates(...)

Search through region to find an entity with start and end coordinates.

TreeRegion.from_coordinate_list()

Work in progress.

TreeRegion.from_json(geometry_tree, ...)

Create a RegionTree from JSON data, must link parent once whole tree is available.

TreeRegion.insert_entity(index, entity)

Insert entity to list of region entities at given index.

TreeRegion.insert_polyline(index, polyline)

Insert polyline at given index, polyline can be made up of line/arc entities.

TreeRegion.is_closed()

Check whether Region's entities are closed.

TreeRegion.limit_arc_chord(max_chord_height)

Limit the chord height for arcs in a region.

TreeRegion.mirror(mirror_line[, unique_name])

Mirror region along entity.

TreeRegion.remove_entity(entity_remove)

Remove the entity from the region.

TreeRegion.replace(replacement_region)

Replace self with another region.

TreeRegion.rotate(centre_point, angle)

Rotate Region around a point for a given angle.

TreeRegion.round_corner(corner_coordinate, ...)

Round the corner of a region.

TreeRegion.round_corners(corner_coordinates, ...)

Round multiple corners of a region.

TreeRegion.subtract(region)

Subtract region from self, returning any additional regions.

TreeRegion.translate(x, y)

Translate Region by specified x,y distances.

TreeRegion.unite(regions)

Unite one or more other regions with self.

TreeRegion.update(region)

Update class fields from another region.

Attributes

TreeRegion.area

Get the region area.

TreeRegion.centroid

Get the region centroid.

TreeRegion.child_keys

Get list of keys corresponding to child nodes.

TreeRegion.child_names

Get list of names corresponding to child nodes.

TreeRegion.children

Get or set parent region.

TreeRegion.colour

Get or set region colour.

TreeRegion.duplication_angle

Get linked Motor-CAD instance.

TreeRegion.duplications

Get or set number of region duplications for the full machine.

TreeRegion.entities

Get or set the list of entities in the region.

TreeRegion.extrusion_blocks

Get extrusion blocks list.

TreeRegion.key

Get key of Region in dict.

TreeRegion.lamination_type

Get or set lamination type of region from Motor-CAD.

TreeRegion.level

Level of region in tree.

TreeRegion.linked_region

Get linked duplication/unite region.

TreeRegion.linked_region_names

Get linked region names for duplication/unite operations.

TreeRegion.linked_regions

Get linked region objects for duplication/unite operations.

TreeRegion.material

Get or set region material name.

TreeRegion.mesh_length

Get or set the mesh length to use, or 0 for default.

TreeRegion.motorcad_instance

Get or set the linked Motor-CAD instance.

TreeRegion.name

Name of Region.

TreeRegion.parent

Get or set parent region.

TreeRegion.parent_key

Get key corresponding to parent region.

TreeRegion.parent_name

Get name corresponding to parent region.

TreeRegion.points

Get points that exist in region.

TreeRegion.region_coordinate

Get the reference coordinate within the region.

TreeRegion.region_type

Get region type.

TreeRegion.singular

Get or set if region is singular.