修改

文檔

圖片

迪威網(wǎng)友2bf9a0
迪威網(wǎng)友2bf9a0
原創(chuàng)模型

船螺旋槳可定制 - OpenSCAD nSpline() 庫與顯示案例

VIP
免費,登錄即可下載
本資源不能下載
發(fā)布時間:2021/1/12 8:23:00
pline
last update 2019-03-14: should work with OpeCAD 2019.01 RC3 and older veio down to OpeCAD 2015.3 now. To update your veion please visit OpeCAD snapshots
With this post I'm publishing my splines library. Its core function is pline(), which does an interpolation over a n-series of m-dimeional vecto each describing a 2D-shape, and calculates in-between values with arbitrary refinement.
The progamming technique behind it is very general, so you might find it useful for your stuff as well.
For example you feed the function with seven 4D-vecto given as a 7x4 array and ask it to return you a 100x4 array. It will interpolate you each of the 4 dimeio over the series of 100 vecto. But you could also feed it with a 10x8 array and receive a 200x8 array with each (!) of the 8 dimeio interpolated.
The m-dimeional vecto you can interpret along your needs, which mea you have to provide a generator function doing that. Usally this function would use some part of such a vector to generate a parametrized 2D-shape and the other part to tralate, rotate, scale, or even colorize this 2D-shape along some trajectory in 3D space. Just like a linear_extrude(), but with much more freedom - and at the price of much more self-respoibility.
For doing a sweep() upon any series of 2D shapes it is tremendously important that no polygon decribing a 2D shape self-inteects and no two 2D shapes within the series mutually inteect. Two 2D shapes may not even share a common vertex. OpeCAD will not check the result of a sweep (which finally executes a polyhedron call) and currently even lets you export a non-manifold STL in some cases - so using this very mighty scheme is a bit like tightrope walking.
I have tested it with great success for several projects, mostly in the field of blade design, but not only. I use it mainly for extrusion with my own sweep() function provided in my Naca_Sweep library. You can also use it without any change with the new skin() function currently evaluated as future language feature by the dev team.
usage scheme - n-dimeional natural cubic spline interpolation
A = [[...],[...],[...]]; define Mxm matrix, M>2, m>1
B = plines(A, N); get interpolated Nxm matrix
C = gen_dat(B); interpret data as sequence of 2D-shapes
and generate trajectory
sweep(B); extrude by knitting polyhedron object
As full blown examples to show the power of the approach I've designed
a customizable boat propeller in that uses airfoil data and some realistic modelling of twist, camber and pitch. Its basic setup coists of 4 well placed slices only, as the slices view shown in the second image reveals - the 4th slice is too small to be visible. The paramete necessary to generate the 2D airfoil data for these four polygo make only a part of the primary data fed into pline(), the other part is used to describe the affine operatio (tralation and rotation) for 3D placement. The rich data set that results from interpolation is interpreted in the same way to generate a rich series of polygo, that can be swept into a full blown propeller blade with smooth surface traitio.
a horn in as part of an itrument. The code uses a Boolean difference operation of an outer and an inner skin object.
For further code examples see the more basic knot() example in the file (slow CGAL-rendering(!)) and
Extrusion functio offer you a lot of freedom, but also put respoibility on you
you must avoid self-inteection of the extruded path. If self-inteection at some point is unavoidable you can try to split the array, sweep all parts separately and use a union().
if you get assertion failures in CGAL rendering, check your design in Thrown Together view (F12) for wrongly (purple) colored triangles. In some cases you will have to just revert the vertex order of your 2D shapes, in othe you might find self-inteectio by closely examining the result in F5/F12 mode.
個文件
壓縮包大?。?MB
小程序二維碼
微信小程序 微信掃碼打開此模型
恒諾鑫科-專注碳素制品的開發(fā)與生產(chǎn)