turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Siemens PLM Community
- NX Customization and Programming
- NX Programming & Customization Forum
- Delaunay triangulation or convex hull

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016 04:48 AM

Hi all.

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?

2 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016 10:09 AM - edited 06-30-2016 10:11 AM

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.html

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[0],edges[1],edges[2],'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()

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

06-30-2016 02:29 PM - edited 06-30-2016 03:15 PM

But I could not install pyhull on windows, I caught an error

Follow Siemens PLM Software

© 2017 Siemens Product Lifecycle Management Software Inc