File Format FCStd/pt-br: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
No edit summary
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{TOCright}}
{{TOCright}}
==Overview==
The '''FreeCAD Standard file format''' ({{FileName|.FCStd}}) is FreeCAD's main file format. It is a compound format, supports compression and embedding of different kinds of data.


<span id="Overview"></span>
== Internals of .FCStd files ==
==Visão geral==


O formato de arquivo '''FreeCAD Standard''' ({{FileName|.FCStd}}) é o principal formato de arquivo do FreeCAD. É um formato composto, que suporta a compactação e a incorporação de diferentes tipos de dados.
FCStd is a [[#Contents | standard zip file containing one or more files]] in a [[#structure |specific structure]]. As such, it is possible to unpack a {{FileName|.FCStd}} file using a regular zip decompression tool, but care needs to be taken while packing the contents of a {{FileName|.FCStd}} file. FreeCAD contains a "Project Utility" to re-pack {{FileName|.FCStd}} files, it's use is described in [[#Change the source of the file .FCStd|Change the source of the file .FCStd]] below.

<span id="Internals_of_.FCStd_files"></span>
== Parte interna dos arquivos .FCStd ==

FCStd é um [[#Estrutura típica|arquivo zip padrão que contém um ou mais a quivos em uma estrutura específica]]. Dessa forma, é possível descompactar um arquivo {{FileName|.FCStd}} usando uma ferramenta de descompactação zip comum, mas é preciso ter cuidado ao compactar o conteúdo de um arquivo {{FileName|.FCStd}}. O FreeCAD contém um "Utilitário de Projeto" para reempacotar arquivos {{FileName|.FCStd}}; seu uso é descrito em [[#Alterar a origem do arquivo .FCStd|Alterar a origem do arquivo .FCStd]] abaixo.


===Document.xml===
===Document.xml===


This is the main {{FileName|.xml}} file describing all the objects inside a FreeCAD document, that is, only the geometric and parametric definition of the objects, not their visual representation. If FreeCAD is ran in console mode (without the GUI), only this {{FileName|Document.xml}} will be used.
Este é o arquivo principal {{FileName|.xml}} que descreve todos os objetos em um documento do FreeCAD, ou seja, apenas a definição geométrica e paramétrica dos objetos, não sua representação visual. Se o FreeCAD for executado no modo console (sem a GUI), apenas esse {{FileName|Document.xml}} será usado.


<span id="Example_Document.xml"></span>
==== Example Document.xml====
==== Exemplo de Documento.xml====


{{Code|lang=xml|code=
{{Code|lang=xml|code=
Line 110: Line 115:
===GuiDocument.xml===
===GuiDocument.xml===


This is the GUI counterpart of the {{FileName|Document.xml}} file. For each object described in the {{FileName|Document.xml}}, there is one corresponding object in {{FileName|GuiDocument.xml}}, describing the visual representation of that object (color, linewidth, etc).
Essa é a contraparte da GUI (Interface gráfica do usuário) do arquivo {{FileName|Document.xml}}. Para cada objeto descrito em {{FileName|Document.xml}}, um objeto correspondente em {{FileName|GuiDocument.xml}}, que descreve a representação visual desse objeto (cor, largura da linha etc.).


===Thumbnails/thumbnail.png===
===Thumbnails/thumbnail.png===


Esta é uma imagem em miniatura de 128x128 pixels do documento, que é uma captura de tela da visualização 3D no momento do salvamento. As miniaturas são geradas somente se a opção correspondente estiver ativada nas preferências do FreeCAD.
This is a 128x128 pixels thumbnail image of the document, which is a screenshot of the 3D view at save time. Thumbnails are generated only if the corresponding option is enabled in the FreeCAD preferences.


===*.brep===
===*.brep===


These are the [[wikipedia:Boundary representation|B-rep]] shapes of all objects that have a Part shape in the {{FileName|Document.xml}}. Each object, even if it is parametric, has its shape stored as an individual {{FileName|.brep}} file, so it can be accessed by components without the need to recalculate the shape.
Essas são as formas [[wikipedia:Boundary representation|B-rep]] de todos os objetos que têm uma forma de peça no {{FileName|Document.xml}}. Cada objeto, mesmo que seja paramétrico, tem sua forma armazenada como um arquivo {{FileName|.brep}} individual, de modo que possa ser acessado por componentes sem a necessidade de recalcular a forma.


===*.svg===
===*.svg===


These are the template svg files used in [[TechDraw Workbench|TechDraw]] pages.
Esses são os arquivos svg de modelo usados nas páginas do [[TechDraw_Workbench/pt-br|TechDraw]].


<span id="Typical_structure"></span>
===Typical structure===
===Estrutura típica===


Structure of a typical {{FileName|.FCStd}} file. The extension can be changed to {{FileName|.zip}} to explore it like a normal directory. The {{FileName|Document.xml}} and {{FileName|GuiDocument.xml}} are at the root of the archive, together with any number of {{FileName|.brp}} (BREP) files. One subdirectory may hold the thumbnail, and another the SVG templates used by [[TechDraw_Workbench|TechDraw]].
Estrutura de um arquivo {{FileName|.FCStd}} típico. A extensão pode ser alterada para {{FileName|.zip}} para explorá-lo como um diretório normal. Os arquivos {{FileName|Document.xml}} e {{FileName|GuiDocument.xml}} estão na raiz do arquivo, juntamente com qualquer número de arquivos {{FileName|.brp}} (BREP). Um subdiretório pode conter a miniatura e outro os modelos SVG usados pelo [[TechDraw_Workbench/pt-br|TechDraw]].


<!--DO NOT remove the <pre> </pre> tags. These are used to display the text exactly like this.-->
<!--DO NOT remove the <pre> </pre> tags. These are used to display the text exactly like this.-->
Line 144: Line 150:
</pre>
</pre>


<span id="Embedding_other_files"></span>
== Embedding other files ==
== Incorporação de outros arquivos ==


In order to embed other file types inside a FCStd file, you must first create a [[scripted_objects|scripted object]] from the [[Python_console|Python console]], and give it an {{incode|App::PropertyFileIncluded}} property.
Para incorporar outros tipos de arquivo em um arquivo FCStd, primeiro crie um [[Scripted_objects/pt-br|Objetos com Script]] no [[Python_console/pt-br|console Python]] e a ele uma propriedade {{incode|App::PropertyFileIncluded}}.


Then in the [[property_editor|property editor]] you can go to the added property and choose a file in the computer. Once the FCStd file is saved, the file assigned to the {{PropertyData|PropertyFileIncluded}} property will be packed inside the {{incode|.FCStd}}. When the document is restored, the same file will be restored with the {{PropertyData|PropertyFileIncluded}} property.
Em seguida, no [[Property_editor/pt-br|editor de propriedades]], você pode ir até a propriedade adicionada e escolher um arquivo no computador. Depois que o arquivo FCStd for salvo, o arquivo atribuído à propriedade {{PropertyData|PropertyFileIncluded}} será compactado dentro do {{incode|.FCStd}}. Quando o documento for restaurado, o mesmo arquivo será restaurado com a propriedade {{PropertyData|PropertyFileIncluded}}.


{{Code|code=
{{Code|code=
Line 155: Line 162:
}}
}}


See the forum thread, [https://forum.freecadweb.org/viewtopic.php?t=38201 PDF inside the project].
Consulte o tópico do fórum, [https://forum.freecadweb.org/viewtopic.php?t=38201 PDF inside the project].

<span id="Change_the_source_of_the_file_.FCStd"></span>
==Alterar a origem do arquivo .FCStd==


* Consulte [[Std_ProjectUtil/pt-br|Std ProjectUtil]].
==Change the source of the file .FCStd==


<span id="Other"></span>
* See [[Std_ProjectUtil|Std ProjectUtil]].
==Outros==


* Um utilitário conversor de arquivos [[ImageConv/pt-br|ImageConv]].
==Other==


* A file Converter utility [[ImageConv|ImageConv]].


{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Revision as of 19:00, 26 July 2023

Visão geral

O formato de arquivo FreeCAD Standard (.FCStd) é o principal formato de arquivo do FreeCAD. É um formato composto, que suporta a compactação e a incorporação de diferentes tipos de dados.

Parte interna dos arquivos .FCStd

FCStd é um arquivo zip padrão que contém um ou mais a quivos em uma estrutura específica. Dessa forma, é possível descompactar um arquivo .FCStd usando uma ferramenta de descompactação zip comum, mas é preciso ter cuidado ao compactar o conteúdo de um arquivo .FCStd. O FreeCAD contém um "Utilitário de Projeto" para reempacotar arquivos .FCStd; seu uso é descrito em Alterar a origem do arquivo .FCStd abaixo.

Document.xml

Este é o arquivo principal .xml que descreve todos os objetos em um documento do FreeCAD, ou seja, apenas a definição geométrica e paramétrica dos objetos, não sua representação visual. Se o FreeCAD for executado no modo console (sem a GUI), apenas esse Document.xml será usado.

Exemplo de Documento.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

Essa é a contraparte da GUI (Interface gráfica do usuário) do arquivo Document.xml. Para cada objeto descrito em Document.xml, há um objeto correspondente em GuiDocument.xml, que descreve a representação visual desse objeto (cor, largura da linha etc.).

Thumbnails/thumbnail.png

Esta é uma imagem em miniatura de 128x128 pixels do documento, que é uma captura de tela da visualização 3D no momento do salvamento. As miniaturas são geradas somente se a opção correspondente estiver ativada nas preferências do FreeCAD.

*.brep

Essas são as formas B-rep de todos os objetos que têm uma forma de peça no Document.xml. Cada objeto, mesmo que seja paramétrico, tem sua forma armazenada como um arquivo .brep individual, de modo que possa ser acessado por componentes sem a necessidade de recalcular a forma.

*.svg

Esses são os arquivos svg de modelo usados nas páginas do TechDraw.

Estrutura típica

Estrutura de um arquivo .FCStd típico. A extensão pode ser alterada para .zip para explorá-lo como um diretório normal. Os arquivos Document.xml e GuiDocument.xml estão na raiz do arquivo, juntamente com qualquer número de arquivos .brp (BREP). Um subdiretório pode conter a miniatura e outro os modelos SVG usados pelo TechDraw.

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

Incorporação de outros arquivos

Para incorporar outros tipos de arquivo em um arquivo FCStd, primeiro crie um Objetos com Script no console Python e dê a ele uma propriedade App::PropertyFileIncluded.

Em seguida, no editor de propriedades, você pode ir até a propriedade adicionada e escolher um arquivo no computador. Depois que o arquivo FCStd for salvo, o arquivo atribuído à propriedade DadosPropertyFileIncluded será compactado dentro do .FCStd. Quando o documento for restaurado, o mesmo arquivo será restaurado com a propriedade DadosPropertyFileIncluded.

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

Consulte o tópico do fórum, PDF inside the project.

Alterar a origem do arquivo .FCStd

Outros

  • Um utilitário conversor de arquivos ImageConv.