FEMAG Script Language (FSL)
Beispiel

Beispiel

Beispiel.png
------------------------------
-- Allgemeine Einstellungen --
------------------------------

exit_on_error = false
exit_on_end = false
verbosity = 2

new_model_force("FML_Bsp","ASM-Nut")

global_unit(mm)
pickdist(0.01)
cosys(cartes)

------------------
-- Nutparameter --
------------------

H0  =  0.5
D1  =    8.0
B1  =    3.0
H1  =    2.0
D2  =   10.0
D3  =    6.0
H2  =   18.0

-----------------
-- FML-Bereich --
-----------------

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)

------------------
-- Knotenketten --
------------------

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()