Hi Jan,
Interesting result.
I was wondering if the STEP export function has the ability to reduce the very
closed point and still keep the same splined curve? Though it is not wanted
here.
Regards,
Cean
> Message: 2
> Date: Sun, 11 Jul 2010 16:36:14 +0000 (GMT)
> From: Jan Martinsen <j.martin...@yahoo.de>
> Subject: [Pythonocc-users] accuracy problem with STEP export
> To: pythonocc-users@gna.org
> Message-ID: <956832.91247...@web29106.mail.ird.yahoo.com>
> Content-Type: text/plain; charset="utf-8"
>
> Dear all,
> with the script below I create several vertices and an interpolating spline
> for
> the upper and lower part of a NACA airfoil. The first attachment shows the
> results in the pythonOCC 3D viewer, which looks fine.
>
> The second attachment shows a zoom of the leading edge of the profile in
> Salome.
> The profile was exported to STEP format in the script below, which was then
> imported in Salome. Unfortunately the spline does not interpolate the dense
> vertices.
>
> Is this a problem of the STEP export function, of the STEP format, or a
> problem
> of Salome? Is it possible to improve the resolution of the STEP export, so
> that
> I can work in Salome without loss of details?
>
> Thanks Jan
>
> This script generated the output:
> from OCC import *
>
> from OCC.Utils.DataExchange.STEP import STEPExporter
> from OCC.BRepBuilderAPI import *
> from OCC.TColgp import *
> from OCC.Geom import *
> from OCC.GeomAbs import *
> from OCC.GeomAPI import *
> from OCC.gp import *
> from numpy import pi,cos,sin,sqrt
>
> from OCC.Display.SimpleGui import *
> display, start_display, add_menu, add_function_to_menu = init_display()
>
> def naca(x,t,c):
>
> y=t/.2*c*(.2969*sqrt(x/c)-.1260*(x/c)-.3516*(x/c)**2+.2843*(x/c)**3-.1015*(x/c)**4)
>
> return y
>
> N=20;
> v=[]
> pt=[]
> upper = TColgp_Array1OfPnt(1,2*N)
> lower = TColgp_Array1OfPnt(1,2*N)
> for i in range(2*N):
> if (i<N):
> x=0.1*i/N
> else:
> x=0.1+0.9*(i-N)/(N-1)
> x=10*x;
> y=naca(x,.12,10)
> pt.append(gp_Pnt(x,y,0));
> v.append(BRepBuilderAPI_MakeVertex(pt[-1]).Shape())
> upper.SetValue(i+1, pt[-1])
> lower.SetValue(i+1, gp_Pnt(x,-y,0))
>
> c= GeomAPI_PointsToBSpline(upper).Curve()
> Eu = BRepBuilderAPI_MakeEdge(c)
> Eu.Build()
> c= GeomAPI_PointsToBSpline(lower,3,8,GeomAbs_C2,1e-6).Curve()
> El = BRepBuilderAPI_MakeEdge(c)
> El.Build()
> # Export to STEP
> my_step_exporter = STEPExporter("naca.stp")
> for vi in v:
> my_step_exporter.AddShape(vi)
> display.DisplayShape(vi)
> my_step_exporter.AddShape(Eu.Shape())
> my_step_exporter.AddShape(El.Shape())
> my_step_exporter.WriteFile()
>
> display.DisplayShape(Eu.Shape())
> display.DisplayShape(El.Shape())
> start_display()
>
> ***********************************************
_________________________________________________________________
MSN十年回馈,每位用户可免费获得价值25元的卡巴斯基反病毒软件2010激活码,快来领取!
http://kaba.msn.com.cn/?k=1
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users