Handbuch: Herkömmliche Modellierung, der CSG Weg

From FreeCAD Documentation
Revision as of 22:31, 22 July 2018 by Le Loup (talk | contribs) (Created page with "Vielleicht denkst Du jetzt, dass wir den kompletten Fuß nur dreimal hätten kopieren müssen, anstatt den Basisquader sechsmal zu duplizieren. Das ist wahr, denn wie immer in...")

CSG steht für Constructive Solid Geometry und beschreibt den üblichen Weg, mit 3D-Objekten zu arbeiten, also komplexe Objekte durch Hinzufügen und Entfernen von Teilen zu/von Volumenkörpern mit Boole'schen Operationen wie Vereinigung, Differenz oder Schnittmenge zu erstellen.

Wie wir früher in diesem Manual gesehen haben, kann FreeCAD viele Arten von Geometrien behandeln, aber der bevorzugte und nützlichste Typ für die Art von 3D-Objekten, die wir mit FreeCAD entwerfen wollen, nämlich reale Objekte, die ohne Zweifel "solide" sind, sind [BREP]-Geometrien, die hauptsächlich im Part-Arbeitsbereich behandelt werden. Im Gegensatz zu [Polygonnetzen], die nur aus Punkten und Dreiecken bestehen, werden bei BREP-Objekten die Oberflächen durch mathematische Kurven definiert, was uneingeschränkte Genauigkeit erlaubt, unabhängig vom Maßstab.

Der Unterschied zwischen den beiden kann mit dem Unterschied zwischen Bitmap- und Vektorgrafiken verglichen werden. Wie bei Bitmap-Grafiken sind gewölbte Oberflächen bei Polygonnetzen unterteilt in eine Reihe von Punkten. Wenn Sie genauer hinsehen oder sehr groß ausdrucken, werden Sie keine gewölbte, sondern eine facettierte Oberfläche sehen. In Vektorgrafiken und BREP-Daten ist die Position eines beliebigen Punktes auf einer Kurve nicht in der Geometrie gespeichert, sondern wird mit der notwendigen Genauigkeit während der Laufzeit berechnet.

In FreeCAD werden alle BREP-basierten Geometrien von einem anderen Stück Open-Source-Software, OpenCasCade, behandelt. Die Hauptschnittstelle zwischen FreeCAD und dem OpenCasCade-Kern ist der Part-Arbeitsbereich. Die meisten anderen Arbeitsbereiche basieren in ihrer Funktionalität auf dem Part-Arbeitsbereich.

Auch wenn andere Arbeitsbereiche oftmals fortgeschrittenere Werkzeuge zur Erstellung und Manipulation von Geometrien anbieten, obwohl sie eigentlich alle Part-Objekte verändern, ist es sehr hilfreich zu wissen, wie diese Objekte intern funktionieren, und die Part-Werkzeuge nutzen zu können, denn weil sie einfacher sind, können sie sehr oft helfen, Probleme zu umgehen, deren Lösung mit den intelligenteren Werkzeugen fehlschlägt.

Um die Arbeitsweise des Part-Arbeitsbereichs zu illustrieren, werden wir diesen Tisch nur mit CSG-Operationen modellieren (außer den Schrauben, für die wir eins der Addons nutzen, und die Abmessungen, wie wir im nächsten Kapitel sehen werden):

Wir legen ein neues Dokument an (Ctrl+N oder Menu Datei -> Neu), wechseln zum Part-Arbeitsbereich und beginnen mit den ersten Fuß:

  • Drücke den Würfel-Button [Anm.d.Ü.: geometrisch gesehen sind es meist "Quader", daher ...]
  • Wähle den Quader, dann setze die folgenden Eigenschaften (im Daten-Reiter):
    • Length: 80mm (oder 8cm, oder 0.8m, FreeCAD arbeitet mit jeder Einheit)
    • Width: 80mm
    • Height: 75cm
  • Dupliziere den Quader durch Drücken von Strg+C, dann Strg+V (oder Menü Bearbeiten -> Kopieren und Einfügen)
  • Wähle das neu erstellte Objekt
  • Ändere die Position durch Anpassen der Placement-Eigenschaften:
    • Position x: 8mm
    • Position y: 8mm

Du solltest jetzt zwei hohe Quader erhalten, der eine 8mm vom anderen entfernt:

  • Jetzt können wir den einen vom anderen subtrahieren: Wähle den ersten, das ist der, der übrig bleibt, dann - mit gedrückter Strg-Taste - wähle den anderen, der subtrahiert wird (die Reihenfolge ist wichtig) und drücke den Cut-Button:

Beachte, dass das neu erzeugte Objekt, "Cut" benannt, noch die beiden Quader enthält, die wir als Operanden benutzt haben. Tatsächlich sind die beiden Quader weiterhin im Dokument, sie wurden einfach versteckt und in der Baumansicht unterhalb des Cut-Objekts angeordnet. Du kannst sie durch expandieren des Pfeils neben dem Cut-Objekt noch auswählen, und durch rechtsklicken wieder sichtbar machen oder jede beliebige Eigenschaft ändern.

  • Jetzt werden wir die drei anderen Füße durch sechsmaliges duplizieren unseres Basisquaders estellen. Da er bereits kopiert wurde, kannst Du einfach sechs Mal einfügen (Strg-V) drücken. Ändere die Positionen wie folgt:
    • cube002: x: 0, y: 80cm
    • cube003: x: 8mm, y: 79.2cm
    • cube004: x: 120cm, y: 0
    • cube005: x: 119.2cm, y: 8mm
    • cube006: x: 120cm, y: 80cm
    • cube007: x: 119.2cm, y: 79.2cm
  • Jetzt werden wir die drei weiteren Schnitte durchführen, indem zuerst der "host"-Quader, dann der abzuschneidende gewählt wird. Wir haben jetzt vier Cut-Objekte:

Vielleicht denkst Du jetzt, dass wir den kompletten Fuß nur dreimal hätten kopieren müssen, anstatt den Basisquader sechsmal zu duplizieren. Das ist wahr, denn wie immer in FreeCAD gibt es viele Wege, um das gleiche Ziel zu erreichen. Es ist wertvoll, sich daran zu erinnern, denn wenn wir zu komplexeren Objekten fortschreiten, gibt es einige Operationen, die möglicherweise nicht das korrekte Ergebnis liefern, und dann müssen wir andere Wege probieren.

  • We will now make holes for the screws, using the same Cut method. Since we need 8 holes, two in each foot, we could make 8 objects to be subtracted. Instead, let's explore other ways and make 4 tubes, that will be reused by two of the feet. So let's create four tubes by using the Cylinder tool. You can again, make only one and duplicate it afterwards. Give all cylinders a radius of 6mm. This time, we will need to rotate them, which is also done via the Placement property:
    • cylinder: height: 130cm, angle: 90°, axis: x:0,y:1, position: x:-10mm, y:40mm, z:72cm
    • cylinder001: height: 130cm, angle: 90°, axis: x:0,y:1, position: x:-10mm, y:84cm, z:72cm
    • cylinder002: height: 90cm, angle: 90°, axis: x:-1,y:0, position: x:40mm, y:-10mm, z:70cm
    • cylinder003: height: 90cm, angle: 90°, axis: x:-1,y:0, position: x:124cm, y:-10mm, z:70cm

You will notice that the cylinders are a bit longer than needed. This is because, as in all solid-based 3D applications, boolean operations in FreeCAD are sometimes oversensitive to face-on-face situations and might fail. By doing this, we put ourselves on the safe side.

  • Now let's do the subtractions. Select the first foot, then, with CTRL pressed, select one of the tubes that crosses it, press the Cut button. The hole will be done, and the tube hidden. Find it in the tree view by expanding the pierced foot.
  • Select another foot pierced by this hidden tube, then repeat the operation, this time Ctrl+ selecting the tube in the tree view, as it is hidden in the 3D view (you can also make it visible again and select it in the 3D view). Repeat this for the other feet until each of them has its two holes:

As you can see, each foot has become a quite long series of operations. All this stays parametric, and you can go change any parameter of any of the older operations anytime. In FreeCAD, we often refer to this pile as "modeling history", since it in fact carries all the history of the operations you did.

Another particularity of FreeCAD is that the concept of 3D object and the concept of 3D operation tend to blend into one same thing. The Cut is at the same time an operation, and the 3D object resulting from this operation. In FreeCAD this is called a "feature", rather than object or operation.

  • Now let's do the tabletop, it will be a simple block of wood, let's do it with another Box with length: 126cm, width: 86cm, height: 8cm, position: x: 10mm, y: 10mm, z, 67cm. In the View tab, you can give it a nice brownish, wood-like color by changing its Shape Color property:

Notice that, although the legs are 8mm thick, we placed it 10mm away, leaving 2mm between them. This is not necessary, of course, it won't happen with the real table, but it is a common thing to do in that kind of "assembled" models, it helps people who look at the model to understand that these are independent parts, that will need to be attached together manually later.

Now that our five pieces are complete, it is a good time to give them more proper names than "Cut015". By right-clicking the objects in the tree view (or pressing F2), you can rename them to something more meaningful to yourself or to another person who would open your file later. It is often said that simply giving proper names to your objects is much more important than the way you model them.

  • We will now place some screws. There is nowadays an extremely useful addon developed by a member of the FreeCAD community, that you can find on the FreeCAD addons repository, called Fasteners, that makes the insertion of screws very easy. Installing additional workbenches is easy and described on the addons pages.
  • Once you have installed the Fasteners Workbench and restarted FreeCAD, it will appear in the workbenches list, and we can switch to it. Adding a screw to one of our holes is done by first selecting the circular edge of our hole:

  • Then we can press one of the screw buttons of the Fasteners Workbench, for example the EN 1665 Hexagon bolt with flanges, heavy series. The screw will be placed and aligned with our hole, and the diameter will automatically be selected to match the size of our hole. Sometimes the screw will be placed inverted, which we can correct by flipping its invert property. We can also set its offset to 2mm, to follow the same rule we used between the tabletop and the feet:

  • Repeat this for all the holes, and our table is complete!

The internal structure of Part objects

As we saw above, it is possible in FreeCAD to select not only whole objects, but parts of them, such as the circular border of our screw hole. This is a good time to have a quick look at how Part objects are constructed internally. Every workbench that produces Part geometry will be based on these:

  • Vertices: These are points (usually endpoints) on which all the rest is built. For example, a line has two vertices.
  • Edges: the edges are linear geometry like lines, arcs, ellipses or NURBS curves. They usually have two vertices, but some special cases have only one (a closed circle for example).
  • Wires: A wire is a sequence of edges connected by their endpoints. It can contain edges of any type, and it can be closed or not.
  • Faces: Faces can be planar or curved, and can be formed by one closed wire, which forms the border of the face, or more than one, in case the face has holes.
  • Shells: Shells are simply a group of faces connected by their edges. It can be open or closed.
  • Solids: When a shell is tightly closed, that is, it has no "leak", it becomes a solid. Solids carry the notion of inside and outside. Many workbenches rely on this to make sure the objects they produce can be built in the real world.
  • Compounds: Compounds are simply aggregates of other shapes, no matter their type, into a single shape.

In the 3D view, you can select individual vertices, edges or faces. Selecting one of these also selects the whole object.

A note about shared design

You might look at the table above, and think its design is not good. The tightening of the feet with the tabletop is probably too weak. You might want to add reinforcing pieces, or simply you have other ideas to make it better. This is where sharing becomes interesting. You can download the file made during this exercise from the link below, and modify it to make it better. Then, if you share that improved file, others might be able to make it even better, or use your well-designed table in their projects. Your design might then give other ideas to other people, and maybe you will have helped a tiny bit to make a better world...

Downloads

Read more