The Open FUSION Toolkit 1.0.0-beta6
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Region Class Reference

Detailed Description

Region class for oftpy.Mesh class.

Public Member Functions

 __init__ (self, points, dx=None, dx_curve=None, angle_tol=30.0, sliver_tol=120.0, small_thresh=None, id=0, load_dict=None)
 Create Region object from a closed bounding curve.
 check_in_poly (self, pt)
 Check if point is inside region (polygon-based approach).
 get_in_point (self, i, dx)
 Get a suitable point for defining the "inside" of the region for triangle.
 get_json (self)
 get_resampled_points (self)
 Get resampled points for bounding curve.
 get_segments (self)
 plot_segments (self, fig, ax, linewidth=None)
 Plot boundary curve.

Protected Attributes

 _dx_curve = load_dict['dx_curve']
 _dx_vol = load_dict['dx_vol']
 _id = load_dict['id']
 _points = load_dict['points']
 _resampled_points = None
list _segments = load_dict['segments']
 _small_thresh = small_thresh

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
points,
dx = None,
dx_curve = None,
angle_tol = 30.0,
sliver_tol = 120.0,
small_thresh = None,
id = 0,
load_dict = None )

Create Region object from a closed bounding curve.

Parameters
pointsList of points forming region boundary [:,2]
dxTarget mesh resolution inside region
angle_tolCorner tolerance used when resampling curve at desired resolution
sliver_tolTolerance used for "sliver" region warnings
small_threshTolerance used for "small" curve warnings (default: dx/2)
idRegion id number (default: 0)

Member Function Documentation

◆ check_in_poly()

check_in_poly ( self,
pt )

Check if point is inside region (polygon-based approach).

Parameters
ptPoint to check [2]
Returns
Is pt inside the region?

◆ get_in_point()

get_in_point ( self,
i,
dx )

Get a suitable point for defining the "inside" of the region for triangle.

Parameters
iIndex of desired nearest boundary point
dxOffset distance from bounding curve
Returns
Point used to define region [2]

◆ get_json()

get_json ( self)

◆ get_resampled_points()

get_resampled_points ( self)

Get resampled points for bounding curve.

Returns
Point list [np,2]

◆ get_segments()

get_segments ( self)

◆ plot_segments()

plot_segments ( self,
fig,
ax,
linewidth = None )

Plot boundary curve.

Parameters
figFigure to add curves to
axAxis to add curves to
linewidthLine width for plots

Member Data Documentation

◆ _dx_curve

_dx_curve = load_dict['dx_curve']
protected

◆ _dx_vol

_dx_vol = load_dict['dx_vol']
protected

◆ _id

_id = load_dict['id']
protected

◆ _points

_points = load_dict['points']
protected

◆ _resampled_points

_resampled_points = None
protected

◆ _segments

_segments = load_dict['segments']
protected

◆ _small_thresh

_small_thresh = small_thresh
protected

The documentation for this class was generated from the following file: