OpenSCAD/Interfaccia utente OpenSCAD: differenze tra le versioni

Wikibooks, manuali e libri di testo liberi.
Contenuto cancellato Contenuto aggiunto
m Wim b ha spostato la pagina OpenSCAD User Manual/Interfaccia utente OpenSCAD a OpenSCAD/Interfaccia utente OpenSCAD senza lasciare redirect: convenzioni di nomenclatura (i nomi dei libri devono essere brevi...
Riga 30: Riga 30:
==== CGAL (Superfici e Griglia, F10 ed F11) ====
==== CGAL (Superfici e Griglia, F10 ed F11) ====


Questo metodo ha bisogno di tempo quando viene usato in un nuovo programma la prima volta, ma poi è molto veloce.
This method might need some time when first used with a new program, but will then have higher framerates.


As before with OpenCSG, F10 and F11 only enable CGAL display mode and don't update the underlying objects; for that, use the ''Compile and Render'' function (F6, found in the ''Design'' menu).
Come detto per OpenCSG, F10 ed F11 abilitano soltanto la modalità CGAL e non aggiornano gli oggetti presenti; per questo usare la funzione ''Compile and Render'' (F6, sotto il menù ''Design'').


To combine the benefits of those two display methods, you can selectively wrap parts of your program in a [[../The OpenSCAD Language#render|render]] function and force them to be baken into a mesh even with OpenCSG mode enabled.
To combine the benefits of those two display methods, you can selectively wrap parts of your program in a [[../The OpenSCAD Language#render|render]] function and force them to be baken into a mesh even with OpenCSG mode enabled.

Versione delle 15:55, 14 feb 2014

Visualizzazione

L'area di visualizzazione è gestita principalmente usando il mouse:

  • Trascinando premendo il tasto sinistro ruota la vista intorno agli assi di visualizzazione, preservando la direzione verticale.
  • Trascinando premendo il tasto sinistro con il tasto SHIFT ruota la vista intorno l'asse verticale e l'asse che puntaverso l'utente.
  • Trascinando premendo il tasto destro muove l'area di visualizzazione.
  • Vi sono quattro modalità per lo zoom:
    • usare la rotella dello scroll
    • trascinare con il tasto centrale del mouse
    • trascinare con il tasto destro o centrale con il tasto SHIFT premuto
    • i tasti PIÙ + e MENO -

La rotazione può essere resettata usando la combinazione Ctrl+0. Il movimento può essere resettato usando la combinazione Ctrl+P.

Configurazione della visualizzazione

L'area di visualizzazione può essere configurata per differenti metodi di rendering ed altre opzioni dal menù View. Molte delle opzioni qui descritte sono anche disponibili usando le combinazioni di tasti.

Modalità di rendering

OpenCSG (F9)

Questo metodo produce risultati istantanei, ma ha una minore velocità di rendering quando ci sono molti oggetti non convessi.

Nota bene: selezionando OpenCSG (tasto F9) si rigenera l'ultima vista generata, ma non viene ricompilato il codice sorgente. In alternativa si può utilizzare la funzione "Compile'" (F5, sotto il menù Design) per ricompilare il codice sorgente, generare gli oggetti OpenCSG ed attivare la vista OpenCSG.

Dettagli di implementazione

In modalità OpenCSG, viene usata la libreria grafica OpenCSG library per generare il modello. Questa libreria usa specifiche OpenGL (2.0) come lo Z buffer e non richiede una descrizione esplicita della mesh risultante – decide, invece, come gli oggetti devono essere combinati. Ad esempio, nel caso di un rendering di un incavo sferico in un cubo, prima si fa il rendering del cubo, poi quello della sfera, ma invece di usare lo Z buffer per nascondere le parti della sfera coperte dal cubo, si fa il rendering solo delle parti visibili della sfera.

CGAL (Superfici e Griglia, F10 ed F11)

Questo metodo ha bisogno di tempo quando viene usato in un nuovo programma la prima volta, ma poi è molto veloce.

Come detto per OpenCSG, F10 ed F11 abilitano soltanto la modalità CGAL e non aggiornano gli oggetti presenti; per questo usare la funzione Compile and Render (F6, sotto il menù Design).

To combine the benefits of those two display methods, you can selectively wrap parts of your program in a render function and force them to be baken into a mesh even with OpenCSG mode enabled.

Dettagli di implementazione

The acronym CGAL refers to The Open Source Computational Geometry Algorithms Library.

In CGAL mode, the CGAL library is used to compute the mesh of the root object, which is then displayed using simple OpenGL.

Opzioni di visualizzazione

Mostra gli spigoli Show Edges (Ctrl+1)

The difference between the CGAL and OpenSCAD approaches can be seen at edges created by boolean operations.

If Show Edges is enabled, both OpenCSG and CGAL mode will render edges as well as faces, CGAL will even show vertices. In CGAL grid mode, this option has no effect.

Enabling this option shows the difference between OpenCSG and CGAL quite clearly: While in CGAL mode you see an edge drawn everywhere it "belongs", OpenCSG will not show edges resulting from boolean operations – this is because they were never explicitly calculated but are just where one object's Z clipping begins or ends.

Mostra gli assi Show Axes (Ctrl+2)

If Show Axes is enabled, the origin of the global coordinate system will be indicated by an orthogonal axes indicator. Additionally, a smaller axes indicator with axes names will be shown in the lower left corner of the viewing area. The smaller axes indicator is marked x, y, z and coloured red, green, blue respectively.

Mostra il reticolo Show Crosshairs (Ctrl+3)

If Show Crosshairs is enabled, the center of the viewport will be indicated by four lines pointing in the room diagonal directions of the global coordinate system. This is useful when aligning the viewing area to a particular point in the model to keep it centered on screen during rotation.

Animation

The Animate option adds an animation bar to the lower edge of the screen. As soon as FPS and Steps are set (reasonable values to begin with are 10 and 100, respectively), the current Time is incremented by 1/Steps, FPS times per second, until it reaches 1, when it wraps back to 0.

Every time Time is changed, the program is re-evaluated with the variable $t set to the current time. Read more about how $t is used in section Other_Language_Features

Allineamento delle viste

Gli item del menù Top, Bottom, …, Diagonal e Center (Ctrl+4, Ctrl+5, …, Ctrl+0, Ctrl+P) allineano la vista al sistema delle coordinate globali.

Top, Bottom, Left, Right, Front e Back allineano parallelamente agli assi, l'opzione Diagonal allinea in diagonale, come quando OpenSCAD viene avviato.

The Center option will put the coordinate center in the middle of the screen (but not rotate the view).

By default, the view is in Perspective mode, meaning that distances far away from the viewer will look shorter, as it is common with eyes or cameras. When the view mode is changed to Orthogonal, visible distances will not depend on the camera distance (the view will simulate a camera in infinite distance with infinite focal length). This is especially useful in combination with the Top etc. options described above, as this will result in a 2D image similar to what one would see in an engineering drawing.