Cancel
Showing results for 
Search instead for 
Did you mean: 

Thousands of tiny lines to a spline

Honored Contributor
Honored Contributor

NX9

 

We recieved some faro arm data, which consists of thousands upon thousands of tiny line segements.  We would like nice splines, and the options as I see:

 

Fit Curve:  But this requires a lot of line picking

 

Build new splines, on top of the tiny lines, using the endpoints to define the spline.

 

Any other options, or suggestions?

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10
14 REPLIES 14

Re: Thousands of tiny lines to a spline

Siemens Phenom Siemens Phenom
Siemens Phenom

Write a program.

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA

Re: Thousands of tiny lines to a spline

Honored Contributor
Honored Contributor

Wish I knew how, that's one bit of training I haven't had.

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Thousands of tiny lines to a spline

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

How close do you need the spline to be to the faro data? I suggest only using the minimum amount of data to get the shape you need. Using "thousands upon thousands" of data points to define a spline will result in a nearly useless spline. The spline data itself will be very "heavy" and other features generated from the spline (a tube or freeform surface) will follow suit.

Re: Thousands of tiny lines to a spline

Siemens Phenom Siemens Phenom
Siemens Phenom

If you can get the Faro data as points, you could then use the 'Fit Curve' routine to do a best fit operation which would 'average' out the data points and give you a much simpler curve than actually using ALL the points as spline points.  The simplest program, if you couldn't ger the Faro data as points directly, would be to get a file of points, either as a text file or a part file and then interactively run the 'Fit Curve' function on the results (if it's a text file, importing them first as points).

John R. Baker, P.E. (ret)
EX-Product 'Evangelist'
Irvine, CA

Re: Thousands of tiny lines to a spline

Honored Contributor
Honored Contributor

It doesn't need to be every end point of the lines precise.  I have the user building splines over the lines, picking a point every so often, and making sure they lie on top, without any strange deviations.  I thinkt that will work.  Then I will talk to QC and see if they can output actual splines next time.

 

Thanks!

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Thousands of tiny lines to a spline

Siemens Phenom Siemens Phenom
Siemens Phenom

You (or someone) could write a small program to create points at the start and end of every line. It would only be about half a dozen lines of code using GRIP or SNAP.

 

Then you can use Spline-->Fit, and select the points by rectangle or polygon.

山田
yamada

Re: Thousands of tiny lines to a spline

Siemens Phenom Siemens Phenom
Siemens Phenom

Here is the SNAP code to create points on all your lines:

 

Option Infer On
Imports Snap, Snap.Create, Snap.UI.Selection

Module NXJournal

   Sub Main()

      ' Create a selection dialog
      Dim dialog = SelectObject("Select lines")

      ' Allow selection of multiple lines
      dialog.SetFilter(Snap.NX.ObjectTypes.Type.Line)
      dialog.AllowMultiple = True

      ' Display the dialog and get a result
      Dim result = dialog.Show()

      ' Cycle through the lines, creating points
      For Each obj In result.Objects
         Dim line = CType(obj, Snap.NX.Line)
         Point(line.StartPoint)
         Point(line.EndPoint)
      Next

   End Sub

End Module

 

 

山田
yamada

Re: Thousands of tiny lines to a spline

Honored Contributor
Honored Contributor

Thanks, I'll have to play with that code!

-Dave
NX1867(if it had versions) | Teamcenter 11.6 | Windows 10

Re: Thousands of tiny lines to a spline

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Best way ugopen application.

Can you upload example of your file with 1000 and 1000 lines?

Lines in file - line-by-line, when end of line is a start next line?