Public viewer

Deformation Aligned Symmetric Airfoil

Published by pamela_hauff ยท Updated 2026-03-17T21:09:16 UTC

Published grammar

This page uses the same scene-first presentation as the gallery viewer while also showing the source grammar text.

//------------------------------------------------
// Symmetric airfoil grammar using DSX alignment
//------------------------------------------------

Start ->
    SymmetricAirfoil(28 1.2 0.12 0.03)

//------------------------------------------------
// SymmetricAirfoil(segmentCount chord thickness zThickness)
// thick is the symmetric NACA thickness ratio
//------------------------------------------------

SymmetricAirfoil(n chord thick zt) ->
    UpperSurface(0 n chord thick zt)
    LowerSurface(0 n chord thick zt)

//------------------------------------------------
// Upper surface
//------------------------------------------------

UpperSurface(i n chord thick zt) ->
    ?(i<n) Upper(i n chord thick zt) : End

Upper(i n chord thick zt) ->
    UpperStrip(i n chord thick zt)
    UpperSurface(i+1 n chord thick zt)

UpperStrip(i n chord thick zt) ->
[
    T(
        -(chord*0.5)+((i/n)*chord)
        0
        0
    )
    SegmentUpper(i n chord thick zt)
]

SegmentUpper(i n chord thick zt) ->
    ?(i+1<n) SegmentUpperBody(i n chord thick zt) : End

SegmentUpperBody(i n chord thick zt) ->
[
    S(
        (chord/n)
        (chord*5*thick*(0.2969*sqrt((i+1)/n)-0.1260*((i+1)/n)-0.3516*((i+1)/n)^2+0.2843*((i+1)/n)^3-0.1015*((i+1)/n)^4))
        zt
    )
    DSX(
        1
        ((chord*5*thick*(0.2969*sqrt(i/n)-0.1260*(i/n)-0.3516*(i/n)^2+0.2843*(i/n)^3-0.1015*(i/n)^4))/(chord*5*thick*(0.2969*sqrt((i+1)/n)-0.1260*((i+1)/n)-0.3516*((i+1)/n)^2+0.2843*((i+1)/n)^3-0.1015*((i+1)/n)^4)+0.000001))
        1
    )
    T(
        (chord/(2*n))
        ((chord*5*thick*(0.2969*sqrt(i/n)-0.1260*(i/n)-0.3516*(i/n)^2+0.2843*(i/n)^3-0.1015*(i/n)^4)+chord*5*thick*(0.2969*sqrt((i+1)/n)-0.1260*((i+1)/n)-0.3516*((i+1)/n)^2+0.2843*((i+1)/n)^3-0.1015*((i+1)/n)^4))/2)
        0
    )
    [ A(180 1) I(Cube smoothConcrete 1) ]
]

//------------------------------------------------
// Lower surface
//------------------------------------------------

LowerSurface(i n chord thick zt) ->
    ?(i<n) Lower(i n chord thick zt) : End

Lower(i n chord thick zt) ->
    LowerStrip(i n chord thick zt)
    LowerSurface(i+1 n chord thick zt)

LowerStrip(i n chord thick zt) ->
[
    T(
        -(chord*0.5)+((i/n)*chord)
        0
        0
    )
    SegmentLower(i n chord thick zt)
]

SegmentLower(i n chord thick zt) ->
    ?(i+1<n) SegmentLowerBody(i n chord thick zt) : End

SegmentLowerBody(i n chord thick zt) ->
[
    S(
        (chord/n)
        (chord*5*thick*(0.2969*sqrt((i+1)/n)-0.1260*((i+1)/n)-0.3516*((i+1)/n)^2+0.2843*((i+1)/n)^3-0.1015*((i+1)/n)^4))
        zt
    )
    DSX(
        1
        ((chord*5*thick*(0.2969*sqrt(i/n)-0.1260*(i/n)-0.3516*(i/n)^2+0.2843*(i/n)^3-0.1015*(i/n)^4))/(chord*5*thick*(0.2969*sqrt((i+1)/n)-0.1260*((i+1)/n)-0.3516*((i+1)/n)^2+0.2843*((i+1)/n)^3-0.1015*((i+1)/n)^4)+0.000001))
        1
    )
    T(
        (chord/(2*n))
        -((chord*5*thick*(0.2969*sqrt(i/n)-0.1260*(i/n)-0.3516*(i/n)^2+0.2843*(i/n)^3-0.1015*(i/n)^4)+chord*5*thick*(0.2969*sqrt((i+1)/n)-0.1260*((i+1)/n)-0.3516*((i+1)/n)^2+0.2843*((i+1)/n)^3-0.1015*((i+1)/n)^4))/2)
        0
    )
    [ A(180 1) I(Cube smoothConcrete 1) ]
]

End ->

Viewer notes

Scene viewer is loaded from the embedded modular editor in read-only mode.
Orbit, zoom, grid, and axis widget remain available.
Use the gallery to jump between published grammars without leaving the live viewer workflow.