File Format FCStd/es: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(43 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
Un proyecto de FreeCAD es en realidad un archivo zip que siempre contiene un archivo Document.xml y opcionalmente varios archivos de datos, un GuiDocument.xml un una imagen en miniatura en formato PNG.
{{TOCright}}

<span id="Overview"></span>
==Resumen==

El '''FreeCAD Standard formato de archivo''' ({{FileName|.FCStd}}) es el principal formato de archivo de FreeCAD. Es un formato compuesto, soporta la compresión y la incrustación de diferentes tipos de datos.

<span id="Internals_of_.FCStd_files"></span>
== Internos de los archivos .FCStd ==

<div class="mw-translate-fuzzy">
FCStd es un [[#Contenido | archivo zip estándar que contiene uno o más archivos]] en una [[#estructura |específica]]. Como tal, es posible desempaquetar un archivo {{FileName|.FCStd}} utilizando una herramienta de descompresión zip normal, pero hay que tener cuidado al empaquetar el contenido de un archivo {{FileName|.FCStd}}. FreeCAD contiene una "Utilidad de Proyecto" para re-empaquetar archivos {{FileName|.FCStd}}, su uso se describe en [[#Cambiar la fuente del archivo .FCStd|Cambiar la fuente del archivo .FCStd]] más abajo.
</div>

===Document.xml===

Este es el archivo principal {{FileName|.xml}} que describe todos los objetos dentro de un documento de FreeCAD, es decir, sólo la definición geométrica y paramétrica de los objetos, no su representación visual. Si FreeCAD se ejecuta en modo consola (sin la GUI), sólo se utilizará este {{FileName|Document.xml}}.

<span id="Example_Document.xml"></span>
==== Ejemplo Document.xml====


{{Code|lang=xml|code=
==Estructura del Document.xml==
<syntaxhighlight>
<?xml version='1.0' encoding='utf-8'?>
<?xml version='1.0' encoding='utf-8'?>
<!--
<!--
Line 94: Line 113:
</ObjectData>
</ObjectData>
</Document>
</Document>
}}
</syntaxhighlight>
==Change the source of the file .FCStd==
{{VeryImportantMessage|<br>'''ATTENTION ALWAYS WORK ON A COPY OF YOUR PROJECT !'''}}


===GuiDocument.xml===
It is possible to change the source of a file .FCStd but the procedure is not without risk it is for this reason that we need to work on a '''copy'''.


Es la contrapartida de la interfaz gráfica de usuario del archivo {{FileName|Document.xml}}. Para cada objeto descrito en {{FileName|Document.xml}}, hay un objeto correspondiente en {{FileName|GuiDocument.xml}}, que describe la representación visual de ese objeto (color, ancho de línea, etc).
After having made an '''copy''' of your project, follow these steps :


<span id="Thumbnails/thumbnail.png"></span>
Create a new directory and place your copy in that directory (there may be many files in your FCStd).
===Miniaturas/thumbnail.png===


Esta es una imagen en miniatura de 128x128 píxeles del documento, que es una captura de pantalla de la vista 3D en el momento de guardar. Las miniaturas se generan sólo si la opción correspondiente está activada en las preferencias de FreeCAD.
* Go in '''Menu > tools > Project utility... Project utility'''
[[File:Project utility en.png|240px]]
* Source : Give your copy to unpack path.
* Destination : Give the path to the unzipped files.
* Click {{KEY|Extract}}
* Go to your directory and open both files '''GuiDocument.xml''' andt '''Document.xml''' using [http://notepad-plus-plus.org/ Notepad++] (Windows) (Notepad++ to modify a word in all open documents).
*'''GuiDocument.xml''' : contains all your project information to the interface, display in the Combo view, the configuration of FreeCAD . . .
**Example with '''Text004'''
<syntaxhighlight>
<ViewProvider name="Text004">
<Properties Count="9">
<Property name="DisplayMode" type="App::PropertyEnumeration">
<Integer value="1"/>
</Property>
<Property name="FontName" type="App::PropertyString">
<String value="Arial"/>
</Property>
<Property name="FontSize" type="App::PropertyFloat">
<Float value="5.199999809265"/>
</Property>
<Property name="Justification" type="App::PropertyEnumeration">
<Integer value="0"/>
</Property>
<Property name="LineSpacing" type="App::PropertyFloat">
<Float value="0.600000023842"/>
</Property>
<Property name="Rotation" type="App::PropertyAngle">
<Float value="0.000000000000"/>
</Property>
<Property name="RotationAxis" type="App::PropertyEnumeration">
<Integer value="2"/>
</Property>
<Property name="TextColor" type="App::PropertyColor">
<PropertyColor value="4294901760"/>
</Property>
<Property name="Visibility" type="App::PropertyBool">
<Bool value="true"/>
</Property>
</Properties>
</ViewProvider>
</syntaxhighlight>
*'''Document.xml''' : contains all information relating to the constituent objects your project.
**Example with '''Text004'''
<syntaxhighlight>
<Object type="App::Annotation" name="Text004" />
</syntaxhighlight>


===*.brep===


Estas son las formas [[wikipedia:Boundary representation|B-rep]] de todos los objetos que tienen una forma de Parte en el {{FileName|Document.xml}}. Cada objeto, incluso si es paramétrico, tiene su forma almacenada como un archivo individual {{FileName|.brep}}, por lo que puede ser accedido por los componentes sin necesidad de recalcular la forma.
<syntaxhighlight>
<Object name="Text004">
<Properties Count="3">
<Property name="Label" type="App::PropertyString">
<String value="Text004"/>
</Property>
<Property name="LabelText" type="App::PropertyStringList">
<StringList count="1">
<String value="135"/>
</StringList>
</Property>
<Property name="Position" type="App::PropertyVector">
<PropertyVector valueX="-30.000000000000" valueY="26.000000000000" valueZ="0.000000000000"/>
</Property>
</Properties>
</Object>


===*.svg===
</syntaxhighlight>
* Information such as :
<syntaxhighlight>
<VectorList file="Points1"/>
<ColorList file="DiffuseColor"/>
<Mesh file="MeshKernel.bms"/>
<Part file="PartShape.brp2"/>
. . . .
</syntaxhighlight>
* as well as other definitions containers '''file=''' relate has a file and if you change example "'''DiffuseColor'''" in '''<ColorList file="DiffuseColor"/>''' You must also change the name of the file for correspondence.
* Once the Word change is identified, '''search''' (your Word) and '''Replace by''' (your new word) and click on {{KEY|Replace in all open documents}} and your change will be the same in both files '''GuiDocument.xml''' and '''Document.xml'''.
* When changes are complete, return to the tool '''Menu > Tools > Project utility... Create project'''
* Source : Give the path of the file that you just changed and that is to restore.
* Destination : Give the path of the FCStd file to restore.
* Click {{KEY|...}} In the new window click on {{KEY|Create a new folder}} (to avoid errors by rewriting the file) and you post. Click on {{KEY|Create}} you can check the "Load project file after creation".
* If you have checked "Load project file after creation" your project will load in FreeCAD.
* '''PS :''' It is imperative that it have concordance GuiDocument.xml, Document.xml documents and files without which there will be errors in your .FCStd file. To do this should always work on a copy of your project.


Estos son los archivos svg de plantilla utilizados en las páginas de [[TechDraw_Workbench/es|TechDraw]].
==Otros==
Más información sobre el formato [[Fcstd_file_format/es|Fcstd]].


<span id="Typical_structure"></span>
Utilidad de conversión [[ImageConv/es|ImageConv]].
===Estructura típica===


Estructura de un archivo típico {{FileName|.FCStd}}. La extensión puede cambiarse a {{FileName|.zip}} para explorarlo como un directorio normal. Los archivos {{FileName|Document.xml}} y {{FileName|GuiDocument.xml}} están en la raíz del archivo, junto con cualquier número de archivos {{FileName|.brp}} (BREP). Un subdirectorio puede contener la miniatura, y otro las plantillas SVG utilizadas por [[TechDraw_Workbench/es|TechDraw]].
[[Category:User Documentation]]

<!--DO NOT remove the <pre> </pre> tags. These are used to display the text exactly like this.-->
<pre>
File.FCStd (File.zip)
|
|--thumbnails/
| |
| :--Thumbnail.png
|
:--Document.xml
:--GuiDocument.xml
:--Shape1.brp
:--Shape2.brp
:--MyPage.svg
:--etc.
</pre>

<span id="Embedding_other_files"></span>
== Incrustar otros archivos ==

Para incrustar otros tipos de archivos dentro de un archivo FCStd, primero hay que crear un [[Scripted_objects/es|objeto scriptado]] desde la [[Python_console/es|consola de Python]], y darle una propiedad {{incode|App::PropertyFileIncluded}}.

A continuación, en el [[Property_editor/es|Editor de propiedades]] puede ir a la propiedad añadida y elegir un archivo en el ordenador. Una vez guardado el archivo FCStd, el archivo asignado a la propiedad {{PropertyData|PropertyFileIncluded}} se empaquetará dentro del {{incode|.FCStd}}. Al restaurar el documento, se restaurará el mismo archivo con la propiedad {{PropertyData|PropertyFileIncluded}}.

{{Code|code=
custom_obj = App.ActiveDocument.addObject("App::FeaturePython", "CustomObject")
custom_obj.addProperty("App::PropertyFileIncluded", "AttachedFile")
}}

Ver el hilo del foro, [https://forum.freecadweb.org/viewtopic.php?t=38201 PDF dentro del proyecto].

<span id="Change_the_source_of_the_file_.FCStd"></span>
==Cambiar la fuente del archivo .FCStd==

* Ver [[Std_ProjectUtil/es|Std ProjectUtil]].


{{Userdocnavi{{#translation:}}}}
[[Category:Developer{{#translation:}}]]
[[Category:Developer Documentation{{#translation:}}]]
[[Category:File_Formats{{#translation:}}]]
{{clear}}
{{clear}}
<languages/>

Latest revision as of 14:15, 30 April 2024

Resumen

El FreeCAD Standard formato de archivo (.FCStd) es el principal formato de archivo de FreeCAD. Es un formato compuesto, soporta la compresión y la incrustación de diferentes tipos de datos.

Internos de los archivos .FCStd

FCStd es un archivo zip estándar que contiene uno o más archivos en una específica. Como tal, es posible desempaquetar un archivo .FCStd utilizando una herramienta de descompresión zip normal, pero hay que tener cuidado al empaquetar el contenido de un archivo .FCStd. FreeCAD contiene una "Utilidad de Proyecto" para re-empaquetar archivos .FCStd, su uso se describe en Cambiar la fuente del archivo .FCStd más abajo.

Document.xml

Este es el archivo principal .xml que describe todos los objetos dentro de un documento de FreeCAD, es decir, sólo la definición geométrica y paramétrica de los objetos, no su representación visual. Si FreeCAD se ejecuta en modo consola (sin la GUI), sólo se utilizará este Document.xml.

Ejemplo Document.xml

<?xml version='1.0' encoding='utf-8'?>
 <Document SchemaVersion="4">
    <Properties Count="9">
       <Property name="Comment" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="Company" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="CreatedBy" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="CreationDate" type="App::PropertyString">
          <String value="Fri Jan 29 15:14:38 2010 "/>
       </Property>
       <Property name="FileName" type="App::PropertyString">
          <String value="/tmp/test.FCStd"/>
       </Property>
       <Property name="Id" type="App::PropertyString">
          <String value="201b746f-a1ed-4297-bf3d-65d5ec11abe0"/>
       </Property>
       <Property name="Label" type="App::PropertyString">
          <String value="names"/>
       </Property>
       <Property name="LastModifiedBy" type="App::PropertyString">
          <String value=""/>
       </Property>
       <Property name="LastModifiedDate" type="App::PropertyString">
          <String value="Fri Jan 29 15:15:21 2010 "/>
       </Property>
    </Properties>
    <Objects Count="2">
       <Object type="Mesh::Cube" name="Cube" />
       <Object type="Part::Box" name="Box" />
    </Objects>
    <ObjectData Count="2">
       <Object name="Cube">
          <Properties Count="7">
             <Property name="Height" type="App::PropertyFloatConstraint">
                <Float value="10"/>
             </Property>
             <Property name="Label" type="App::PropertyString">
                <String value="Cube"/>
             </Property>
             <Property name="Length" type="App::PropertyFloatConstraint">
                <Float value="10"/>
             </Property>
             <Property name="Mesh" type="Mesh::PropertyMeshKernel">
                <Mesh file="MeshKernel.bms"/>
             </Property>
             <Property name="Placement" type="App::PropertyPlacement">
                <PropertyPlacement Px="0" Py="0" Pz="0" Q0="0" Q1="0" Q2="0" Q3="1"/>
             </Property>
             <Property name="Pos" type="App::PropertyPlacementLink">
                <Link value=""/>
             </Property>
             <Property name="Width" type="App::PropertyFloatConstraint">
                <Float value="10"/>
             </Property>
          </Properties>
       </Object>
       <Object name="Box">
          <Properties Count="7">
             <Property name="Height" type="App::PropertyLength">
                <Float value="10"/>
             </Property>
             <Property name="Label" type="App::PropertyString">
                <String value="Box2"/>
             </Property>
             <Property name="Length" type="App::PropertyLength">
                <Float value="10"/>
             </Property>
             <Property name="Placement" type="App::PropertyPlacement">
                <PropertyPlacement Px="0" Py="0" Pz="0" Q0="0" Q1="0" Q2="0" Q3="1"/>
             </Property>
             <Property name="Pos" type="App::PropertyPlacementLink">
                <Link value=""/>
             </Property>
             <Property name="Shape" type="Part::PropertyPartShape">
                <Part file="PartShape.brp2"/>
             </Property>
             <Property name="Width" type="App::PropertyLength">
                <Float value="10"/>
             </Property>
          </Properties>
       </Object>
    </ObjectData>
 </Document>

GuiDocument.xml

Es la contrapartida de la interfaz gráfica de usuario del archivo Document.xml. Para cada objeto descrito en Document.xml, hay un objeto correspondiente en GuiDocument.xml, que describe la representación visual de ese objeto (color, ancho de línea, etc).

Miniaturas/thumbnail.png

Esta es una imagen en miniatura de 128x128 píxeles del documento, que es una captura de pantalla de la vista 3D en el momento de guardar. Las miniaturas se generan sólo si la opción correspondiente está activada en las preferencias de FreeCAD.

*.brep

Estas son las formas B-rep de todos los objetos que tienen una forma de Parte en el Document.xml. Cada objeto, incluso si es paramétrico, tiene su forma almacenada como un archivo individual .brep, por lo que puede ser accedido por los componentes sin necesidad de recalcular la forma.

*.svg

Estos son los archivos svg de plantilla utilizados en las páginas de TechDraw.

Estructura típica

Estructura de un archivo típico .FCStd. La extensión puede cambiarse a .zip para explorarlo como un directorio normal. Los archivos Document.xml y GuiDocument.xml están en la raíz del archivo, junto con cualquier número de archivos .brp (BREP). Un subdirectorio puede contener la miniatura, y otro las plantillas SVG utilizadas por TechDraw.

File.FCStd (File.zip)
  |
  |--thumbnails/
  |  |
  |  :--Thumbnail.png
  |
  :--Document.xml
  :--GuiDocument.xml
  :--Shape1.brp
  :--Shape2.brp
  :--MyPage.svg
  :--etc.

Incrustar otros archivos

Para incrustar otros tipos de archivos dentro de un archivo FCStd, primero hay que crear un objeto scriptado desde la consola de Python, y darle una propiedad App::PropertyFileIncluded.

A continuación, en el Editor de propiedades puede ir a la propiedad añadida y elegir un archivo en el ordenador. Una vez guardado el archivo FCStd, el archivo asignado a la propiedad DatosPropertyFileIncluded se empaquetará dentro del .FCStd. Al restaurar el documento, se restaurará el mismo archivo con la propiedad DatosPropertyFileIncluded.

custom_obj = App.ActiveDocument.addObject("App::FeaturePython", "CustomObject")
custom_obj.addProperty("App::PropertyFileIncluded", "AttachedFile")

Ver el hilo del foro, PDF dentro del proyecto.

Cambiar la fuente del archivo .FCStd