Hi Clock,
good point with the aspect ratio.
So why do I have so much points on the 2d profile so far:
I fit a nurbs curve from points (code below). The the resulting nurbs curve however does not exactly pass the points (can i enfoce this somehow?). Therefore, getting curves from a set of points and a subset with half of the points results in a different profile.
-> how should I get a curve passing exactly through the given points (from python), such that the results for the two curves are similar?
import bpy
import math
import numpy as np
def curveFromPoints(coords,name,tClosed):
# create the Curve Datablock
curveData = bpy.data.curves.new(name, type='CURVE')
curveData.dimensions = '3D'
curveData.resolution_u = 2
# map coords to spline
polyline = curveData.splines.new('NURBS')
polyline.points.add(len(coords))
for i, coord in enumerate(coords):
x,y,z = coord
polyline.points[i].co = (x, y, z, 1)
if(tClosed):
polyline.use_cyclic_u = True
# create Object
curveOB = bpy.data.objects.new(name, curveData)
# attach to scene and validate context
scn = bpy.context.scene
scn.objects.link(curveOB)
scn.objects.active = curveOB
curveOB.select = True
#----------------------------------------------------------------------------------
def h105Coords(tFine):
if(not tFine):
hCoord=[(1.0000000000,-0.0009960075,0.0),
(0.9923910747,0.0008730353,0.0),
(0.9732261933,0.0061049655,0.0),
(0.9028826756,0.0228094365,0.0),
(0.5656912247,0.0715014889,0.0),
(0.1135761203,0.0489492481,0.0),
(0.0035325422,0.0069703941,0.0),
(0.0000000000,0.0000000000,0.0),
(0.0109729439,-0.0106883099,0.0),
(0.2435759130,-0.0497218477,0.0),
(0.8109499838,-0.0136364597,0.0),
(0.9842246660,-0.0002785008,0.0),
(0.9960683709,-0.0007296290,0.0)]
else:
hCoord=[(1.0000000000,-0.0009960075,0.0,),
(0.9968850158,-0.0002131417,0.0,),
(0.9923910747,0.0008730353,0.0,),
(0.9841079235,0.0032235503,0.0,),
(0.9732261933,0.0061049655,0.0,),
(0.9494646214,0.0120285280,0.0,),
(0.9028826756,0.0228094365,0.0,),
(0.7465577106,0.0520873754,0.0,),
(0.5656912247,0.0715014889,0.0,),
(0.3662695884,0.0746947582,0.0,),
(0.1135761203,0.0489492481,0.0,),
(0.0228438073,0.0207011579,0.0,),
(0.0035325422,0.0069703941,0.0,),
(0.0000000000,0.0000000000,0.0,),
(0.0109729439,-0.0106883099,0.0,),
(0.0555936001,-0.0264323653,0.0,),
(0.2435759130,-0.0497218477,0.0,),
(0.6224089664,-0.0347331559,0.0,),
(0.8109499838,-0.0136364597,0.0,),
(0.9368195370,-0.0013936882,0.0,),
(0.9842246660,-0.0002785008,0.0,),
(0.9960683709,-0.0007296290,0.0)]
return hCoord
#---------------------------------------------
hCoord=h105Coords(False) #tFine
curveFromPoints(hCoord,'h105fine_2D',True)