Hi Marcos,
Thomas gave me the NACA function some time ago.
Here you are:
from OCC.Utils.Common import interpolate_points_to_spline_no_tangency
from OCC.Utils.Construct import *
def naca_curve(length, thickness_to_chord, show=False):
def y(x):
x_c = x/c
x_c2 = x_c * x_c
x_c3 = x_c2 * x_c
x_c4 = x_c3 * x_c
y =
10*t*c*(0.2929*sqrt(x_c)-0.1260*x_c-0.3516*x_c2+0.2843*x_c3-0.1015*x_c4)
return y
c = length
t = thickness_to_chord
points_coord = []
x = 0.0
x_step = 0.1
while x<=c:
points_coord.append([x,y(x)])
x += x_step
crv1, crv2 = [], []
for point in points_coord:
P1 = gp_Pnt(point[0], 0.0, point[1])
P2 = gp_Pnt(point[0], 0.0, -point[1])
if show:
display.DisplayShape(map(make_vertex, [P1,P2]))
crv1.append(P1)
crv2.append(P2)
interpolated_curve1 =
make_edge(interpolate_points_to_spline_no_tangency(crv1,
False,
False
)
)
return interpolated_curve1
Cheers,
-jelle
On Apr 25, 2010, at 8:31 PM, Marcos Elgueta Soulat wrote:
Hi Thomas,
First, I would like to ask you if exist some pythonOCC package for
Ubuntu 9.10?
About the (X,Y,Z) arrays structure, I think could be useful the
_ThruSection class along the wing axis! In this case I could combine
the algorithm for 2D geometries (airfoils) to replace the used NACA
curves.
By other hand, the arrays from the original algorithm for 3D
geometries have the following structure:
X = (x_point1, x_point2, x_point3, ..., x_pointN)
Y = (y_point1, y_point2, y_point3, ..., y_pointN)
Z = (z_point1, z_point2, z_point3, ..., z_pointN)
I will generate the arrays with real data to be more specific and
clear.
Regards!
Marcos.
On 24 April 2010 06:00, <pythonocc-users-requ...@gna.org> wrote:
Send Pythonocc-users mailing list submissions to
pythonocc-users@gna.org
To subscribe or unsubscribe via the World Wide Web, visit
https://mail.gna.org/listinfo/pythonocc-users
or, via email, send a message with subject or body 'help' to
pythonocc-users-requ...@gna.org
You can reach the person managing the list at
pythonocc-users-ow...@gna.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Pythonocc-users digest..."
Today's Topics:
1. Re: 3D CAD Model from arrays (X, Y, Z) point
coordinates.
(Thomas Paviot)
----------------------------------------------------------------------
Message: 1
Date: Fri, 23 Apr 2010 13:19:44 +0200
From: Thomas Paviot <tpav...@gmail.com>
Subject: Re: [Pythonocc-users] 3D CAD Model from arrays (X, Y, Z)
point coordinates.
To: "pythonOCC users mailing list." <pythonocc-users@gna.org>
Message-ID:
<j2qbfc3e86e1004230419z57c44686obd9d1d87dffc7...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
2010/4/23 Marcos Elgueta Soulat <m.a.elguetasou...@gmail.com>
> Dear pythonOCC-users,
>
> I'm working in my final carrer project (Aerospace Engineering),
which is
> related with Parametric Geometry Representation to support
Aircraft Design
> Procedures.
>
> I implement a mathematic algorithm, able to generate different
aircraft
> components and configurations geometries.
>
> I already evaluate this with a simple visualization using MayaVi,
but it is
> just a nice picture (Not useful for further analysis). Due to, I
would like
> to know:
>
> *How can I generate from Python-2.6 a CAD-model in pythonOCC?
>
> **Note: the 3D geometry is defined by 3 arrays that contents (X,Y,Z)
> coordinates respectively?*
>
> I appreciate any help!
>
> Best Regards,
>
> Marcos.
>
>
> --
> Marcos A. Elgueta Soulat
> Student of Aerospace Engineering,
> Department of Mechanics Engineering,
> University of Concepci?n, Chile.
>
> mail: m.a.elguetasou...@gmail.com
> mobile(1): +56 9 82208407
> mobile(2): +56 9 83036927
> skype: marcos.elgueta.soulat
>
>
Hi Marcos,
Welcome to this list.
The difficulty of the surface construction depends on the structure
of your
(x,y,z) arrays. A few months ago, Jelle and I worked on the
construction of
a an aircraft wing surface. It was generated from many NACA curves
and the
use of the _ThruSection class along the wing axis. Could it be of
interest
for your purpose? If the (x,y,z) arrays structure is a triangle or
quad
mesh, it will be much more difficult to generate the BRep surface.
Could you
tell us a bit more about your coordinate arrays?
Regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /public/pythonocc-users/attachments/20100423/5cc141b1/
attachment.htm
------------------------------
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users
End of Pythonocc-users Digest, Vol 17, Issue 14
***********************************************
--
Marcos A. Elgueta Soulat
Student of Aerospace Engineering,
Department of Mechanics Engineering,
University of Concepción, Chile.
mail: m.a.elguetasou...@gmail.com
mobile(1): +56 9 82208407
mobile(2): +56 9 83036927
skype: marcos.elgueta.soulat
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users