OpenSCAD

Сайт: Virtuálna Univerzita Mateja Bela
Курс: 3D tlač a 3D modelovanie
Книга: OpenSCAD
Напечатано:: Guest user
Дата: понедельник, 20 мая 2024, 08:58

Описание

OpenSCAD is software for creating 3D CAD models. It is free and available for Linux/UNIX, Windows, and Mac OS X. Unlike most 3D modeling software, it does not focus on the artistic aspects of 3D modeling but rather on CAD aspects.

OpenSCAD is non-interactive. Instead, it functions as a 3D compiler that reads a script file describing an object and renders a 3D model based on that script. It provides full control over the modeling process, allowing easy modification of any step in the modeling process or creating designs defined by configurable parameters.

It offers two main modeling techniques: Constructive Solid Geometry (CSG) and 2D outline extrusion. AutoCAD DXF files can be used as a data exchange format for these 2D outlines. Besides 2D paths for extrusion, it's also possible to read design parameters from DXF files. In addition to DXF files, OpenSCAD can read and create 3D models in STL and OFF formats.


Source: OpenSCAD - About

Оглавление

1. Interface


OpenSCAD is divided into two primary columns.

The left column is a text editor where you write OpenSCAD scripting language for creating models. Any model you create will be "written" in this text editor.

At the top of the right column is a "virtual" 3D space where programmed models are displayed. Upon launching OpenSCAD, you can see the reference axes X, Y, and Z.
At the bottom of the virtual space is the function panel. The most important function is "preview" (F5), which projects the written object into our space. Equally important is the "render" function. Other functions serve for zooming, rotating the view, or toggling axis visibility.
At the bottom of the right column, you will find the console where OpenSCAD will output any error messages or additional information while creating models.

2. Tutorials

OpenSCAD offers a set of documentation that teaches us how to work with the text editor.

All the documentation is available for free at the link: OpenSCAD - Documentation

For familiarizing yourself with the environment, it's good to go through at least the first chapter and program a car according to the instructions.

Result: 



Code: 

cube([60,20,10],center=true);
translate([5,0,10 - 0.001])
    cube([30,20,10],center=true);
translate([-20,-15,0])
    rotate([90,0,0])
    cylinder(h=3,r=8,center=true);
translate([-20,15,0])
    rotate([90,0,0])
    cylinder(h=3,r=8,center=true);
translate([20,-15,0])
    rotate([90,0,0])
    cylinder(h=3,r=8,center=true);
translate([20,15,0])
    rotate([90,0,0])
    cylinder(h=3,r=8,center=true);
translate([-20,0,0])
    rotate([90,0,0])
    cylinder(h=30,r=2,center=true);
translate([20,0,0])
    rotate([90,0,0])
    cylinder(h=30,r=2,center=true);