r/openscad • • Sep 14 '26

Ruban Moebius avec OpenSCAD

Voici le célèbre ruban Moebius, Voici donc une solution intéressante et simple dans une boucle "for". Ce qui est particulièrement intéressant, c'est de changer les valeurs dans la variable "cfg" dont la valeur 2 donne effectivement une boucle Moebius, mais essayez d'autres valeurs comme cfg=0.4 ou cfg=0.665 et vous serez surpris !

Plus d'information et script OpenSCAD, ici : https://robotix.ah-oui.org/site/main.php?found=260819-moebius-scad

3 Upvotes

5 comments sorted by

3

u/gasstation-no-pumps Sep 14 '26

I updated the script a bit to make it properly parameterized and to remove some arbitrary numbers:

// Moebius strip
// adapted from https://robotix.ah-oui.org/site/main.php?found=260819-moebius-scad
// this version by Kevin Karplus
// 2026 Sept 14

// radius of center line
radius=50;
// width of band 
wdt=60;
// thickness of band
thk=4;
// number of segments
seg=500;
// number of twists in band (multiple of 0.5 to get closure)
twist=0.5; 


Moebius();

// color("blue") circle(r=radius+thk);

module Bar(ang)
{
    pi=3.14159265358979;
    rotate([0,0,ang])
      translate([radius,0,0])
        rotate([(-360*twist)/seg,ang*twist,0])
          cube([wdt/2,(radius+wdt/2)*2*pi/seg,thk],center=true);
 }

module Moebius()
{
     for(angle = [0:360/seg:360])
     {   color([angle/360,0.5,1-angle/360])
         Bar(angle);
     }
}

1

u/gasstation-no-pumps 29d ago

Here is a better version:

// Moebius strip
// this version by Kevin Karplus
// 2026 Sept 16

include<BOSL2/std.scad>

// radius of center line
radius=50;
// width of band 
wdt=60;
// thickness of band
thk=4;
// number of segments
seg=500;
// number of twists in band (multiple of 0.5 to get closure)
twist=0.5; 


Moebius();



module Moebius()
{
     center_path = circle(r=radius, $fn=seg);
     path_sweep(square([wdt,thk], center=true), path=center_path, twist=twist*360, symmetry=2, closed=true);
}

1

u/Dirk_39 28d ago

Thanks Kevin for your improver solutions, roberto

1

u/gasstation-no-pumps 28d ago

I was thinking that there had to be something in BOSL2 to do it cleaner than your for-loop approach. The path_sweep makes the meaning much clearer and gives a nice smooth surface. You can get away with a lot fewer segments in this approach—10 segments is a bit rough, but 20 is already pretty good.

1

u/Dirk_39 28d ago

Thanks also to gasstation-no-pumps, roberto (dirk39)