yorik wrote: ↑Tue Nov 14, 2017 12:14 pm
renatorivo wrote: ↑Sun Nov 12, 2017 10:25 pmHow can I add other classes?
Basically you need to add a new function in ArchProfile.py. Then inside ArchProfile.makeProfile, add a new case to use your new function in case of a certain letter ("L" or "Z" etc). Then you just need to populate the csv file with some new presets.
Hello there, I follow the Yorick's advice and I wrote a script to draw a L profile section with Height H, Base B and thickness s. How can I add a new case whit this script ?
Code: Select all
## L-shaped
import Part
import math
from FreeCAD import Vector
#
#VALUES#
H=30.0 # mm Height
B=20.0 # mm Base
s= 4.0 # mm Thickness
# Coordinate dei punti nel sistema di riferimento con origine il punto 0
p0= Vector(0,0,0)
p1= Vector(s,0,0)
p2= Vector(s,H-s,0)
p3= Vector(B,H-s,0)
p4= Vector(B,H,0)
p5= Vector(0,H,0)
#p= Part.makePolygon([p0,p1,p2,p3,p4,p5,p0])
#p= Part.Face(p)
#Part.show(p)
# Coordinate dei punti nel sistema di riferimento con origine il baricentro
VG=Vector(-(H*s**2/2+(B-s)*s*(s+(B-s)/2))/((B-s)*s+H*s),-(H**2*s/2+(B-s)*(H-s/2)*s)/((B-s)*s+H*s),0)
P0= p0.add(VG)
P1= p1.add(VG)
P2= p2.add(VG)
P3= p3.add(VG)
P4= p4.add(VG)
P5= p5.add(VG)
P= Part.makePolygon([P0,P1,P2,P3,P4,P5,P0])
P= Part.Face(P)
Part.show(P)