Drawing templates/it: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 5: Line 5:
* Un pixel = un millimetro
* Un pixel = un millimetro
* È necessario inserire, da qualche parte all'interno del proprio codice svg, dove si desidera che appaia il contenuto del disegno (per esempio alla fine del file, appena prima dell'ultimo tag </svg>), la seguente riga:
* È necessario inserire, da qualche parte all'interno del proprio codice svg, dove si desidera che appaia il contenuto del disegno (per esempio alla fine del file, appena prima dell'ultimo tag </svg>), la seguente riga:
width="1067mm"
height="762mm"
or
width="1067"
height = "762"
Although svg supports inches ("42 in"), these are currently not supported by FreeCAD, so it's always better to have your svg page size specified in millimeters. The "viewBox" attribute must have the same value, for example:
viewBox="0 0 1067 762"
* You must insert, somewhere inside your svg code, where you want the contents of the drawing to appear (for example at the end of the file, just before the last </svg> tag), the following line:
<syntaxhighlight>
<syntaxhighlight>
<!-- DrawingContent -->
<!-- DrawingContent -->
</syntaxhighlight>
</syntaxhighlight>
This text above (which is actually an XML comment) must be on a separate line, and not embedded in the middle of other pieces of text. Beware that if you reopen and resave your template in inkscape, after adding the above line, inkscape will keep the line, but will add other xml elements on the same line, causing the template to not work anymore. You will need to edit it with a text editor and isolate the comment above on its own line again.
=== Namespace ===
* Several objects (specifically those created with the [[Drawing_Draft]] command and if your template has editable texts) use a special [[Svg Namespace]] specific to FreeCAD. This makes FreeCAD able to detect specific items inside svg files, that other applications will just ignore. If you plan to use any of these, you must add this line inside the opening <svg> tag, for example together with the other xmlns lines added by inkscape:
xmlns:freecad="http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace"
Oltre a queste due regole, a partire da FreeCAD 0.14, Rev. 2995, al modello possono essere aggiunte le informazioni sul bordo e sulla tabella. Esse sono usate dallo strumento di proiezione ortogonale e definiscono dove FreeCAD può, e non può effettuare le proiezioni.
Oltre a queste due regole, a partire da FreeCAD 0.14, Rev. 2995, al modello possono essere aggiunte le informazioni sul bordo e sulla tabella. Esse sono usate dallo strumento di proiezione ortogonale e definiscono dove FreeCAD può, e non può effettuare le proiezioni.


To define the Border, the following line must appear before the <metadata> tag in the svg file.
Per definire il bordo dell'area utilizzata, prima del tag <metadata nel file svg, deve apparire la seguente riga:
<syntaxhighlight>
<syntaxhighlight>
<!-- Working space X1 Y1 X2 Y2 -->
<!-- Working space X1 Y1 X2 Y2 -->
</syntaxhighlight>
</syntaxhighlight>
Where X1, Y1, X2, Y2 are defined as:
Dove:
* X1 is the X axis distance from the left edge of the page to the left side of the Border.
* X1 è la distanza dell'asse X dal lato sinistro della pagina al lato sinistro del bordo.
* Y1 is the Y axis distance from the top edge of the page to the top of the Border.
* Y1 è la distanza dell'asse Y dal lato superiore della pagina al lato superiore del bordo.
* X2 is the X axis distance from the left edge of the page to the right side of the Border.
* X2 è la distanza dell'asse X dal lato sinistro della pagina al lato destro del bordo.
* Y2 is the Y axis distance from the top edge of the page to the bottom of the Border.
* Y2 è la distanza dell'asse Y dal lato superiore della pagina al lato inferiore del bordo.
[[File:XY_Working_v2.svg]]
[[File:XY_Working_v2.svg]]


Line 25: Line 37:
<!-- Title block X1a Y1a X2a Y2a -->
<!-- Title block X1a Y1a X2a Y2a -->
</syntaxhighlight>
</syntaxhighlight>
Where X1a, Y1a, X2a, Y2a are defined as:
Dove:
* X1a is the X axis distance from the left edge of the page to the left side of the Title block
* X1a è la distanza dell'asse X dal bordo sinistro della pagina al lato sinistro del blocco del titolo.
* Y1a is the Y axis distance from the top edge of the page to the top of the Title block
* Y1a è la distanza dell'asse Y dal bordo superiore della pagina al lato superiore del blocco del titolo.
* X2a is the X Axis distance from the left edge of the page to the right side of the Title block
* X2a è la distanza dell'asse X dal bordo sinistro della pagina al lato destro del blocco del titolo.
* Y2a is the Y axis distance from the top edge of the page to the bottom of the Title block
* Y2a è la distanza dell'asse Y dal bordo superiore della pagina al lato inferiore del blocco del titolo.
* X1a <= X1 oppure X2a >= X2
* X1a <= X1 or X2a >= X2
* Y1a <= Y1 oppure Y2a >= Y2
* Y1a <= Y1 or Y2a >= Y2
[[File:XY_Title_v2.svg]]
[[File:XY_Title_v2.svg]]


The following is an example of the code that defines the Working space and Title block areas that are to be inserted before the <metadata> tag. You needn't specify a title block, but if you do it must be defined on the next line immediately following the Working space:
Il seguente è un esempio del codice che deve essere inserito prima del tag <metadata per definire l'area di lavoro e l'area della tabella. Non è obbligatorio definire una tabella, ma quando si fa la tabella deve essere definita nella riga successiva a quella della definizione dello spazio di lavoro:
<syntaxhighlight>
<syntaxhighlight>
<!-- Working space X1 Y1 X2 Y2 -->
<!-- Working space X1 Y1 X2 Y2 -->

Revision as of 13:46, 14 September 2016

Creare modelli SVG

Creare dei nuovi modelli di fogli per il modulo di disegno di proiezione Drawing è molto semplice. Oltre a questa pagina consultare anche il tutorial Creare dei modelli. I modelli sono dei file SVG creati con qualsiasi applicazione in grado di esportare file SVG, ad esempio Inkscape. Si devono seguire solo due regole:

  • Un pixel = un millimetro
  • È necessario inserire, da qualche parte all'interno del proprio codice svg, dove si desidera che appaia il contenuto del disegno (per esempio alla fine del file, appena prima dell'ultimo tag </svg>), la seguente riga:
width="1067mm"
height="762mm"

or

width="1067"
height = "762"

Although svg supports inches ("42 in"), these are currently not supported by FreeCAD, so it's always better to have your svg page size specified in millimeters. The "viewBox" attribute must have the same value, for example:

viewBox="0 0 1067 762"
  • You must insert, somewhere inside your svg code, where you want the contents of the drawing to appear (for example at the end of the file, just before the last </svg> tag), the following line:
 <!-- DrawingContent -->

This text above (which is actually an XML comment) must be on a separate line, and not embedded in the middle of other pieces of text. Beware that if you reopen and resave your template in inkscape, after adding the above line, inkscape will keep the line, but will add other xml elements on the same line, causing the template to not work anymore. You will need to edit it with a text editor and isolate the comment above on its own line again.

Namespace

  • Several objects (specifically those created with the Drawing_Draft command and if your template has editable texts) use a special Svg Namespace specific to FreeCAD. This makes FreeCAD able to detect specific items inside svg files, that other applications will just ignore. If you plan to use any of these, you must add this line inside the opening <svg> tag, for example together with the other xmlns lines added by inkscape:
xmlns:freecad="http://www.freecadweb.org/wiki/index.php?title=Svg_Namespace"

Oltre a queste due regole, a partire da FreeCAD 0.14, Rev. 2995, al modello possono essere aggiunte le informazioni sul bordo e sulla tabella. Esse sono usate dallo strumento di proiezione ortogonale e definiscono dove FreeCAD può, e non può effettuare le proiezioni.

To define the Border, the following line must appear before the <metadata> tag in the svg file.

<!-- Working space X1 Y1 X2 Y2 -->

Where X1, Y1, X2, Y2 are defined as:

  • X1 is the X axis distance from the left edge of the page to the left side of the Border.
  • Y1 is the Y axis distance from the top edge of the page to the top of the Border.
  • X2 is the X axis distance from the left edge of the page to the right side of the Border.
  • Y2 is the Y axis distance from the top edge of the page to the bottom of the Border.

To define the Title block the following line must be inserted before the <metadata> tag and after the Working space tag.

<!-- Title block X1a Y1a X2a Y2a -->

Where X1a, Y1a, X2a, Y2a are defined as:

  • X1a is the X axis distance from the left edge of the page to the left side of the Title block
  • Y1a is the Y axis distance from the top edge of the page to the top of the Title block
  • X2a is the X Axis distance from the left edge of the page to the right side of the Title block
  • Y2a is the Y axis distance from the top edge of the page to the bottom of the Title block
  • X1a <= X1 or X2a >= X2
  • Y1a <= Y1 or Y2a >= Y2

The following is an example of the code that defines the Working space and Title block areas that are to be inserted before the <metadata> tag. You needn't specify a title block, but if you do it must be defined on the next line immediately following the Working space:

<!-- Working space X1 Y1 X2 Y2 -->
<!-- Title block X1a Y1a X2a Y2a -->

Per scalare la stampa, la dimensione effettiva deve essere data negli attributi width e height del tag SVG. Le dimensioni del documento, nelle unità utilizzate (px), deve essere fornita nell'attributo Viewbox.

In questo caso deve essere formattato come nell'esempio sottostante dove:

  • xxx = pixel width larghezza
  • yyy = pixel height altezza
width="xxxmm"
height="yyymm"
viewBox="0 0 xxx yyy"
  • Nelle squadrature si possono posizionare diversi attributi personalizzati. L'elenco degli attributi attualmente supportati sono disponibili nella pagina Svg Namespace.
  • Di default, i modelli di squadrature, nei sistemi Windows si trovano in C:/Program Files/FreeCAD0.13/data/Mod/Drawing/Templates/A3_Landscape.svg, e nei sistemi Linux in /usr/share/freecad/Mod/Drawing/Templates/A3_Landscape.svg.

Modelli DXF

Dalla versione 0.15, FreeCAD può esportare in modo affidabile una pagina Drawing nel formato DXF. Questo sistema utilizza anche i modelli. Se nella stessa cartella del modello SVG utilizzata per una pagina si trova anche un file dxf con lo stesso nome, esso viene utilizzato per l'esportazione. In caso contrario, viene creato al volo un modello vuoto predefinito.

Di conseguenza, se si crea i propri modelli SVG, e si vuole essere in grado di esportare in DXF le pagine create con Drawing, è sufficiente creare un modello DXF corrispondente, e salvarlo con lo stesso nome nella stessa cartella.

I modelli DXF possono essere creati con qualsiasi applicazione che produce dei file DXF, come LibreCAD. È quindi necessario modificarli con un editor di testo, e aggiungere due ulteriori righe, una all'inizio o alla fine della sezione BLOCKS, e un'altra all'inizio o alla fine della sezione ENTITIES, che sono il posto dove FreeCAD aggiungerà i propri blocchi e entità.

Un modello molto semplice si presenta così:

999
FreeCAD DXF exporter v0.15
0
SECTION
2
HEADER
9
$ACADVER
1
AC1009
0
ENDSEC
0
SECTION
2
BLOCKS
$blocks
0
ENDSEC
0
SECTION
2
ENTITIES
$entities
0
ENDSEC
0
EOF

Il modello precedente non contiene alcuna entità. Se si crea il file DXF con un'applicazione CAD, ci sarà probabilmente molto più contenuto all'interno delle sezioni HEADER, BLOCKS e ENTITIES.

Le due righe cercate da FreeCAD sono "$blocks" e "$entities". Esse devono essere esistenti nel modello, e devono essere posizionate sulla loro riga. Si può scegliere di metterle subito dopo le righe BLOCKS o ENTITIES, che è più facile (basta utilizzare la funzione "cerca" del vostro editor di testo per trovarle), o alla fine, prima delle righe "0 ENDSEC" (fate attenzione che ce n'è una per ogni sezione, assicurarsi di usare quella relativa a BLOCKS e ENTITIES). Quest'ultimo metodo mette gli oggetti di FreeCAD dopo gli oggetti definiti nel modello, che potrebbe essere più logico.

Modelli A3

A3 Classic:

A3 Clean:

A3 Modern:

A3 Showcase:

A3 Landscape english:

Modelli A4

A4 Landscape english:

A4 Portrait 1 english:

Modelli US Letter

US Letter landscape:


US Letter portrait:

US Letter ds Landscape:

US Legal ds Landscape:

US Ledger ds Landscape:

Altri standard disponibili