how to export a series of points on a curve

Need help, or want to share a macro? Post here!
silent_missile
Posts: 16
Joined: Mon Jul 29, 2019 11:07 pm

how to export a series of points on a curve

Postby silent_missile » Tue Sep 24, 2019 12:57 am

here is a curve, maybe it's generated by NURBS, or it's generated by intersection of 2 surfaces

now I need to export a series of points on the curve to
[[x0, y0, z0], [x1, y1, z1],...]

is there any API can do this? please help me.

also, if I want to modify the resolution of the points, how to do it?
Last edited by silent_missile on Tue Sep 24, 2019 5:14 am, edited 2 times in total.
kisolre
Posts: 1645
Joined: Wed Nov 21, 2018 1:13 pm

Re: how to export a serious points on a curve

Postby kisolre » Tue Sep 24, 2019 5:02 am

I think you meant series (not serious) of points. Please correct your wording so the post will make sence for future searches.

I my script I needed a serie of points along a curve so there is somethig in tit. Check out the thread at https://forum.freecadweb.org/viewtopic.php?f=22&t=38057
User avatar
microelly2
Posts: 4626
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: how to export a series of points on a curve

Postby microelly2 » Tue Sep 24, 2019 5:37 am

you can use discretize

edge=FreeCAD.ActiveDocument.BePlane.Shape.Edge1
pts=edge.discretize(100)
Part.show(Part.makePolygon(pts))