ntrfc.geometry package

Submodules

ntrfc.geometry.alphashape module

ntrfc.geometry.alphashape.auto_concaveHull(xs, ys)
ntrfc.geometry.alphashape.calc_concavehull(x, y, alpha)

origin: https://stackoverflow.com/questions/50549128/boundary-enclosing-a-given-set-of-points/50714300#50714300

ntrfc.geometry.alphashape.calculate_minimal_distances(points)

ntrfc.geometry.line module

ntrfc.geometry.line.lines_from_points(points)

Given an array of points, make a line set

ntrfc.geometry.line.polyline_from_points(points)
ntrfc.geometry.line.refine_spline(x, y, res, half_cosine_spacing=False, kind='linear')

Refine spline using cubic interpolation.

Parameters:
  • x – Array of x coordinates.

  • y – Array of y coordinates.

  • res – Number of interpolated points.

  • half_cosine_spacing – Boolean flag for using half-cosine spacing.

Returns:

Interpolated x and y coordinates.

ntrfc.geometry.plane module

ntrfc.geometry.plane.areaave_plane(mesh, valname)
ntrfc.geometry.plane.inside_poly(polygon, points)
Parameters:
  • polygon – (x,y)

  • points – (x,y)

Returns:

list of True or False for indicating weather inside or not

ntrfc.geometry.plane.massflow_plane(mesh, rhoname='rho', velocityname='U')
ntrfc.geometry.plane.massflowave_plane(mesh, valname, rhoname='rho', velocityname='U')

ntrfc.geometry.surface module

ntrfc.geometry.surface.calc_dist_from_surface(surface_primary, surface_secondary, verbose=False)

Distance Between Two Surfaces / A Surface and a Pointcloud

Compute the average thickness between two surfaces.

We can compute the thickness between the two surfaces using a few different methods. We will demo a method where we compute the normals of the bottom surface, and then project a ray to the top surface to compute the distance along the surface normals. :param surface_primary: pv.UnstructuredGrid :param surface_secondary: pv.UnstructuredGrid / pv.PolyData :param verbose: plots? :return: surface_primary with distances from secondary

Module contents