{"id":15179,"date":"2024-05-05T10:36:42","date_gmt":"2024-05-05T08:36:42","guid":{"rendered":"https:\/\/linux-bibel.at\/?p=15179"},"modified":"2024-05-05T10:36:44","modified_gmt":"2024-05-05T08:36:44","slug":"openscad-3d-cad-fuer-linux","status":"publish","type":"post","link":"https:\/\/linux-bibel.at\/index.php\/2024\/05\/05\/openscad-3d-cad-fuer-linux\/","title":{"rendered":"OpenSCAD &#8211; 3D-CAD f\u00fcr Linux"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Ob f\u00fcr die CNC-Fr\u00e4\u00dfe oder f\u00fcr den 3D-Drucker, CAD-Software wird ben\u00f6tigt, um 3D-Modelle zu erstellen. OpenSCAD macht es recht einfach, unter Linux in CAD-Software einzusteigen.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OpenSCAD installieren<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software wie \u00fcblich ganz einfach \u00fcber die Paket-Verwaltung durch das Paket &#8222;<strong>openscad<\/strong>&#8222;. F\u00fcr Linux-Distributionen, die das Paket nicht in ihren Repositorys mitf\u00fchren, steht ein <a href=\"https:\/\/linux-bibel.at\/index.php\/2023\/09\/03\/flatpak-pakete-nutzen-noch-mehr-software\/\" data-type=\"post\" data-id=\"746\">Flatpak<\/a>-Paket bereit.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">OpenSCAD nutzen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sie finden diese Software nach der Installation im Anwendungsmen\u00fc unter der Kategorie Grafik und Bildbearbeitung, alternativ nutzen Sie den Schnellstarter (<em>Alt+F2<\/em>) oder (<em>als Debian-Paket installiert<\/em>) das Terminal mit dem Befehl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openscad<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad.jpeg\" rel=\"lightbox-0\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"713\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1024x713.jpeg\" alt=\"\" class=\"wp-image-15180\" style=\"width:538px;height:auto\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1024x713.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-150x104.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-300x209.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-768x535.jpeg 768w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad.jpeg 1430w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Die Software zeigt in ihrem Startfenster rechts ein paar Beispiele und Grundfunktionen, wir beginnen gleich einmal mit einem Klick auf den Schalter &#8222;<strong>Neu<\/strong>&#8222;, um eine neue Datei zu erstellen:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-scaled.jpeg\" rel=\"lightbox-1\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-1024x640.jpeg\" alt=\"\" class=\"wp-image-15181\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-1-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Links sehen Sie den Editor, in der Mitte oben die Anzeige des 3D-Objekts, darunter die Konsole und rechts die Einstellungen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Nun, wollen wir einmal beginnen &#8211; in OpenSCAD arbeiten wir ausschlie\u00dflich mit dem Editor, wir wollen mit einer Kugel anfangen, dazu tippen wir in den Editor folgendes ein:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sphere();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Anschlie\u00dfend klicken wir in der Werkzeugleiste auf den Schalter &#8222;<strong>Vorschau<\/strong>&#8220; (<em>der gestrichelte W\u00fcrfel<\/em>) und schon zeigt sich die Grafik:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-scaled.jpeg\" rel=\"lightbox-2\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-1024x640.jpeg\" alt=\"\" class=\"wp-image-15182\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-2-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wie zu sehen, schlie\u00dfen Sie einen Befehl mit einem Semikolon <code>;<\/code> ab. Klicken Sie mit der linken Maustaste in das Fenster mit der 3D-Ansicht und ziehen, drehen Sie die Ansicht in verschiedene Richtungen, mit der rechten Maustaste verschieben Sie die Ansicht und mit dem Mausrad wird gezoomt.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In der Ansicht selbst zeigen sich nat\u00fcrlich auch die Koordinaten mit den Gr\u00f6\u00dfen. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Eine Sph\u00e4re &#8211; also eine Kugel ist normal rund, geben Sie im Befehl keine Daten an, arbeitet die Software mit ihren Standard-Einstellungen. Unsere Kugel ist sehr eckig &#8211; jetzt \u00e4ndern wir die Anzahl der Kanten &#8211; etwa auf 200:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$fn=200;<br>sphere();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Schon haben wir eine perfekte Kugel:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-scaled.jpeg\" rel=\"lightbox-3\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-1024x640.jpeg\" alt=\"\" class=\"wp-image-15183\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-3-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt haben wir ein Problem &#8211; ich m\u00f6chte jetzt beispielsweise noch eine Sph\u00e4re erstellen, diese w\u00fcrde wieder genau im Mittelpunkt erscheinen. Um die zweite Kugel zu verschieben, damit sich nicht beide \u00fcberlagern, nutzen wir den Befehl <code>translate<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sphere();<br>translate(&#91;3,0,0]) sphere (r=1.5, $fn=200);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-scaled.jpeg\" rel=\"lightbox-4\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-1024x640.jpeg\" alt=\"\" class=\"wp-image-15184\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-4-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Wir erstellen also in der ersten Zeile eine Standard-Kugel mit dem Befehl <code>sphere();<\/code>, in der zweiten Zeile beginnen wir mit einem neuen Objekt &#8211; dieses verschieben wir um drei Punkte nach rechts <code>translate([3,0,0])<\/code> &#8211; damit werden ganz einfach die Koordinaten im Koordinatengitter festgelegt. Danach geben wir das Objekt mit <code>sphere<\/code> vor, mit <code>(r=1.5, $fn=200)<\/code> legen wir den Radius fest und geben die Kanten vor.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wichtig &#8211; da das Komma <code>,<\/code> Angaben trennt, nutzen Sie als Komma den Punkt <code>.<\/code>. Versuchen wir einen Zylinder:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cylinder(h=40, r=5, $fn=6);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-scaled.jpeg\" rel=\"lightbox-5\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-1024x640.jpeg\" alt=\"\" class=\"wp-image-15185\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-5-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Mit <code>h=<\/code> geben wir die H\u00f6he an, mit <code>r=<\/code> den Radius und mit <code>$fn=<\/code> die Kanten. Runden wir den Zylinder etwa ab:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cylinder(h=40, r=5, $fn=200);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-scaled.jpeg\" rel=\"lightbox-6\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-1024x640.jpeg\" alt=\"\" class=\"wp-image-15186\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-6-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Indem wir zwei Radien angeben, kommen wir zu einem Kegel:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cylinder(h=40, r1=5, r2=3, $fn=200);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-scaled.jpeg\" rel=\"lightbox-7\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-1024x640.jpeg\" alt=\"\" class=\"wp-image-15187\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-7-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Jetzt wollen wir einen hohlen Quader versuchen:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>difference(){<br>translate([0,0,5]) color(\"red\", 0.8) cube([5.5, 13, 12], center=true);<br>translate([0,0,15]) color(\"grey\", 1) cube([4.5, 12, 30], center=true);<br>}<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-scaled.jpeg\" rel=\"lightbox-8\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"640\" src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-1024x640.jpeg\" alt=\"\" class=\"wp-image-15188\" srcset=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-1024x640.jpeg 1024w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-1536x960.jpeg 1536w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-2048x1280.jpeg 2048w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-150x94.jpeg 150w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-300x188.jpeg 300w, https:\/\/linux-bibel.at\/wp-content\/uploads\/2024\/05\/openscad-8-768x480.jpeg 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><code>difference<\/code> sorgt daf\u00fcr, dass sich die beiden erstellten Quader abziehen &#8211; so einen Hohlraum bilden. Die Funktionen der Software komplett zu beschreiben, w\u00e4re etwas \u00fcbertrieben &#8211; hierf\u00fcr gibt es die <a href=\"https:\/\/openscad.org\/documentation.html\" target=\"_blank\" rel=\"noreferrer noopener\">Dokumentation<\/a>. Die Software kann nach ein wenig Einarbeitung auch extrem komplexe Modelle erstellen.<\/p>\n<div class=\"pld-like-dislike-wrap pld-custom\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir\" data-post-id=\"15179\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Hoch.png\" alt=\"Gef\u00e4llt mir\" \/>\r\n            <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">1    <\/span>\r\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-dislike-trigger pld-like-dislike-trigger  \" title=\"Gef\u00e4llt mir nicht\" data-post-id=\"15179\" data-trigger-type=\"dislike\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                            <img src=\"https:\/\/linux-bibel.at\/wp-content\/uploads\/2023\/12\/Daumen-Runter.png\" alt=\"Gef\u00e4llt mir nicht\" \/>\r\n            <\/a>\r\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\r\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Ob f\u00fcr die CNC-Fr\u00e4\u00dfe oder f\u00fcr den 3D-Drucker, CAD-Software wird ben\u00f6tigt, um 3D-Modelle zu erstellen. OpenSCAD macht es recht einfach, unter Linux in CAD-Software einzusteigen. OpenSCAD installieren Unter auf Debian basierenden Linux-Distributionen installieren Sie diese Software wie \u00fcblich ganz einfach \u00fcber die Paket-Verwaltung durch das Paket &#8222;openscad&#8222;. F\u00fcr Linux-Distributionen, die das Paket nicht in ihren [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":15188,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[548],"tags":[549],"class_list":["post-15179","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cad","tag-cad"],"_links":{"self":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/15179","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/comments?post=15179"}],"version-history":[{"count":1,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/15179\/revisions"}],"predecessor-version":[{"id":15189,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/posts\/15179\/revisions\/15189"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media\/15188"}],"wp:attachment":[{"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/media?parent=15179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/categories?post=15179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linux-bibel.at\/index.php\/wp-json\/wp\/v2\/tags?post=15179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}