I have field of points. This field lie on part of a 3D surface. I need create a surface by these points or at least create convex hull (closed curve) by these points.
I know about reverse engineering functions (some sort of Fit surface). But this function creates a not limited surface, but I need a limited one.
I can create it manually, but if NXOpen(Python better) has similar function I think it will be productively.
Could you help me?
The NX Open API does not have any built in classes/methods for Delaunay triangulation or convex hull but you can integrate scipy.spatial which does. http://docs.scipy.org/doc/scipy/reference/spatial.
Attached is a tutorial I wrote on how to integrate Anaconda. PM me if there is anything unclear
Below is some example code using matplotlib and scipy.spatial. Be sure to include the space between "nx: "and "threaded"!
#nx: threaded import NXOpen import NXOpen.BlockStyler import NXOpen.Features import NXOpen.UF import NXOpen.GeometricAnalysis import NXOpen.Facet import math import numpy as np import scipy.spatial as sp class 3d_points: #scipy spatial function def convexhull(self, vertices): tri = sp.Delaunay(vertices) hull = sp.ConvexHull(vertices) # Indices of points forming the vertices of the convex hull edges= list(zip(vertices)) #various attributes of the convex hull method hull_points=hull.points hull_vertices=hull.vertices hull_simplices=hull.simplices hull_equations=hull.equations #plot it using mat plot lib for i in hull.simplices: plt.plot(vertices[i,0], vertices[i,1], vertices[i,2], 'r-') ax.plot(edges,edges,edges,'bo') ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlabel('z') ax.set_xlim3d(-2,2) ax.set_ylim3d(-2,2) ax.set_zlim3d(-2,2) plt.show()