Ultima attività 1 month ago

Freecad Parabolica

Revisione 13553750273b37a3f332cd452fd80060c196b2d2

parabolica.py Raw
1import Part, math
2
3focalPoint = 792.0
4diameter = 2200.0
5radius = diameter / 2
6thickness = 3
7
8m=App.Matrix()
9m.rotateY(math.radians(-90))
10# create a parabola
11parabola=Part.Parabola()
12# the axis of the plane the curve is lying on, this sets the symmetry axis to (0,0,1)
13#parabola.Axis=App.Vector(1,0,0)
14parabola.Focal = focalPoint
15parabola.transform(m)
16# get only the right part of the curve
17edge=parabola.toShape(0,radius)
18Part.show(edge)
19face=edge.revolve(App.Vector(0,0,0),App.Vector(0,0,1),360)
20offset=face.makeOffsetShape(-thickness,0.001)
21
22Part.show(offset)