Examples¶
ASM Slot¶
exit_on_error = false
exit_on_end = false
verbosity = 2
new_model_force("FML_Example","ASM Slot")
global_unit('mm')
pickdist(0.01)
cosys('cartes')
-- slot parameter --
H0 = 0.5
D1 = 8.0
B1 = 3.0
H1 = 2.0
D2 = 10.0
D3 = 6.0
H2 = 18.0
-- FML
fml = require("fml")
fml.SetLocalCS(0, 0, 180)
P0a = fml.Point:Create( 1, H0)
P0b = fml.Point:Create(-1, H0)
M1 = fml.Point:Create(0, D1/2)
M2 = fml.Point:Create(0, D1+H1+D2/2)
M3 = fml.Point:Create(0, D1+H1+H2-D3/2)
K1 = fml.Circle:Create(M1, D1/2)
K2 = fml.Circle:Create(M2, D2/2)
K3 = fml.Circle:Create(M3, D3/2)
G0 = fml.Line:Create(P0a, P0b)
G1 = fml.Line:Create(M1, M2)
G2 = fml.Line:Parallel(G1, B1/2)
S0a = fml.Point:Intersection(G0, K1, 1)
S1a = fml.Point:Intersection(G2, K1, 2)
S2a = fml.Point:Intersection(G2, K2, 1)
T2a = fml.Point:Tangent(K2, K3, 1)
T3a = fml.Point:Tangent(K2, K3, 2)
S0b, S1b, S2b, T2b, T3b = fml.Point:Mirror(G1, S0a, S1a, S2a, T2a, T3a)
-- Node chains
ndt(1.0)
nc_line (S0a.x, S0a.y, S0b.x, S0b.y, 0)
nc_circle_m(S0a.x, S0a.y, S1a.x, S1a.y, M1.x, M1.y, D1/2, 0)
nc_line (S1a.x, S1a.y, S2a.x, S2a.y, 0)
nc_circle_m(S2a.x, S2a.y, T2a.x, T2a.y, M2.x, M2.y, D2/2, 0)
nc_line (T2a.x, T2a.y, T3a.x, T3a.y, 0)
nc_circle_m(T3a.x, T3a.y, T3b.x, T3b.y, M3.x, M3.y, D3/2, 0)
nc_line (T3b.x, T3b.y, T2b.x, T2b.y, 0)
nc_circle_m(T2b.x, T2b.y, S2b.x, S2b.y, M2.x, M2.y, D2/2, 0)
nc_line (S2b.x, S2b.y, S1b.x, S1b.y, 0)
nc_circle_m(S1b.x, S1b.y, S0b.x, S0b.y, M1.x, M1.y, D1/2, 0)
adapt_window()
Polschuh¶
exit_on_error = false
exit_on_end = false
verbosity = 2
new_model_force("Polschuh","Test")
global_unit('mm')
pickdist(0.01)
cosys('cartes')
-- FML-Bereich --
fml = require("fml")
-- Parameter:
b1 = 10
h1 = 3
h2 = 2
h3 = 4
r1 = 21
r2 = 16
r3 = 1.0
r4 = 1.2
r5 = 1.4
-- Points
p1 = fml.Point:Create(0, 0)
p2 = fml.Point:Create(b1/2, 0)
p3 = fml.Point:Create(0, h1)
p4 = fml.Point:Create(b1/2, h1)
p5 = fml.Point:Create(0, -h2-h3)
m1 = fml.Point:Create(0, -h2-h3-r1)
m2 = fml.Point:Create(0, -h2-r2)
-- Lines
g1 = fml.Line:Create(p1, p2)
g2 = fml.Line:Create(p2, p4)
-- Circles
c1 = fml.Circle:Create(m1, r1)
c2 = fml.Circle:Create(m2, r2)
-- Node chains
ndt(0.6)
-- Verrundung 1 (Mittelpunkt, Anfangspunkt, Endpunkt):
m3, a3, e3 = fml.Point:Rounding(g1, g2, r3, 2)
nc_circle_m(a3.x, a3.y, e3.x, e3.y, m3.x, m3.y, r3, 0)
-- Verrundung 2 (Mittelpunkt, Anfangspunkt, Endpunkt):
m4, a4, e4 = fml.Point:Rounding(g1, c2, r4, 8)
nc_circle_m(a4.x, a4.y, e4.x, e4.y, m4.x, m4.y, r4, 0)
-- Verrundung 3 (Mittelpunkt, Anfangspunkt, Endpunkt):
m5, a5, e5 = fml.Point:Rounding(c1, c2, r5, 1)
nc_circle_m(a5.x, a5.y, e5.x, e5.y, m5.x, m5.y, r5, 0)
-- oberer Polschuhbogen:
nc_circle_m(e5.x, e5.y, e4.x, e4.y, c2.x, c2.y, c2.r, 0)
-- unterer Polschuhbogen:
nc_circle_m(a5.x, a5.y, p5.x, p5.y, c1.x, c1.y, c1.r, 0)
-- Abschlusslinien:
nc_line(a4.x, a4.y, a3.x, a3.y, 0)
nc_line(e3.x, e3.y, p4.x, p4.y, 0)
nc_line_cont(p3.x, p3.y, 0)
nc_line_cont(p5.x, p5.y, 0)
adapt_window()
-- Meshing
create_mesh()
-- Knotenketten und Netz spiegeln:
mirror_nodechains(p3.x, p3.y, p5.x, p5.y)