from set of points to surface?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 181
- Joined: Tue Oct 21, 2014 9:47 am
- Location: Pau (France)
from set of points to surface?
Hello,
i am looking to a function (or piece of python) to transform a set of 3d points into a surface (mesh)
The set of points were generated by parametric surface (u,v).
Any python function to do that (or oop function)?
Thank you for any kind of help.
Rentlau_64
i am looking to a function (or piece of python) to transform a set of 3d points into a surface (mesh)
The set of points were generated by parametric surface (u,v).
Any python function to do that (or oop function)?
Thank you for any kind of help.
Rentlau_64
Re: from set of points to surface?
Hello.
I remember this thread in the german sub-forum about his subject.
As mentioned in the last post there i remember user microelly2 did a lot of work based on that in his
- reconstruction workbench ... discussion here
- NURBS Editor ... discussion here
Hope this is useful for a start ...
Roland
I remember this thread in the german sub-forum about his subject.
As mentioned in the last post there i remember user microelly2 did a lot of work based on that in his
- reconstruction workbench ... discussion here
- NURBS Editor ... discussion here
Hope this is useful for a start ...
Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english
Native german speaker - so apologies for my english, no offense intended
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english
Native german speaker - so apologies for my english, no offense intended
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: from set of points to surface?
I think this is a good way to start playing
http://freecadbuch.de/doku.php?id=story ... _mass_data
write your own version to generate the data
example:
http://freecadbuch.de/doku.php?id=story ... _mass_data
write your own version to generate the data
example:
Code: Select all
x = np.arange(-5.00, 5.00, 0.5)
y = np.arange(-5.00, 5.00, 0.5)
xx, yy = np.meshgrid(x, y)
z = np.sin(xx**2+yy**2)
setSpreadsheet(ss1,x,y,z)
table2Nurbs(ss1,"waves")
-
- Posts: 181
- Joined: Tue Oct 21, 2014 9:47 am
- Location: Pau (France)
Re: from set of points to surface?
Roland and microelly2,
thank a lot, i will look carefuly at these information.
Have a good day
Rentlau_64
thank a lot, i will look carefuly at these information.
Have a good day
Rentlau_64
-
- Posts: 181
- Joined: Tue Oct 21, 2014 9:47 am
- Location: Pau (France)
Re: from set of points to surface?
microelly2,
I have an error message regarding the test :
ns.table2Nurbs(ss1,"simpe gen data")
I suspect it is my release of Ubuntu...what do you think?
Rentlau_64
I have an error message regarding the test :
ns.table2Nurbs(ss1,"simpe gen data")
The code I typed in the FreeCad python Console:>>> ns.table2Nurbs(ss1,"simpe gen data")
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/home/laurent/.FreeCAD/Mod/nurbs/nurbswb/spreadsheet_lib.py", line 234, in table2Nurbs
,3,3)
TypeError: PyCXX: Error creating object of type N2Py6VectorE from array([ 0. , 0. , 565.71704008])
Code: Select all
import nurbswb.spreadsheet_lib as ns
ss1=ns.createSpreadsheet(label='MySpreadsheet')
ns.gendata(ss1)
ns.table2Nurbs(ss1,"simpe gen data")
Thank youOS: Ubuntu 15.04
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6692 (Git)
Build type: None
Branch: master
Hash: 87293fac9bb85c5f5e0ebf563374e27d565116ae
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
Rentlau_64
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: from set of points to surface?
There was an improvement to handle numpy arrays in 0.17rentlau_64 wrote: TypeError: PyCXX: Error creating object of type N2Py6VectorE from array([ 0. , 0. , 565.71704008])
Version: 0.16.6692 (Git)
Maybe I can make it backward compatible by converting the array to a array of Vectors
starting line 221 insert these lines should help for the first.
Code: Select all
ps=np.array(ps).reshape(NbVPoles,NbUPoles,3)
#-hack for 0.16
ps=[]
for v in range(NbVPoles):
psl=[]
for u in range(NbUPoles):
p=(x[u],y[v],z[v*NbUPoles+u])
psl.append(FreeCAD.Vector(p))
ps.append(psl)
#- end hack
-
- Posts: 181
- Joined: Tue Oct 21, 2014 9:47 am
- Location: Pau (France)
Re: from set of points to surface?
Microelly2,
Thank you for your help i will test your fix this evening.
And will also upgrade my system during Christmas holydays.
Have a nice day.
Rentlau_64
Thank you for your help i will test your fix this evening.
And will also upgrade my system during Christmas holydays.
Have a nice day.
Rentlau_64
-
- Posts: 181
- Joined: Tue Oct 21, 2014 9:47 am
- Location: Pau (France)
Re: from set of points to surface?
Microelly2,
Thank you it worked perfectly! Have a nice evening!
Rentlau_64
Thank you it worked perfectly! Have a nice evening!
Rentlau_64