// slats.cmd // Attempt at minimal refinement to get yellow lead smooth. // Get rid of edges to middle of facets by deleting one edge midrid := { foreach edge ee where (on_constraint 1 or on_constraint 2 or on_constraint 3 or on_constraint 4) and length < .51*width do { unfix ee; unfix ee.vertex vv where abs(vv.x) < .1; delete ee} } // One iteration of refining the curved edges and equiangulating // to get a nice set of slats. slatstep := { refine edge where (original>=17 and original<=20) or (original>=23 and original <= 26); unfix edge ee where sum(ee.facet, color==yellow)==2 and max(ee.vertex,y) > leadheel+.001; u; } // Overall command. Increase the slatstep iteration count if you want // a smoother surface. slats := { midrid; slatstep 4; foreach edge ee where sum(ee.facet,color==yellow) == 2 do { fix ee; fix ee.vertex; set ee no_refine}; set facet no_refine where color==yellow; }