Merge branch 'master' into feature/toggle-active-cmd-support-for-dressups

This commit is contained in:
mlampert
2019-12-20 19:40:25 -08:00
committed by GitHub
53 changed files with 5764 additions and 4756 deletions

143
src/Mod/.gitattributes vendored
View File

@@ -1 +1,144 @@
JtReader export-ignore
# ****************************************************************************
# line endings
# to surpress line ending changes in github, add ?w=1 at link end of a diff
# for more information see forum topic and a specific pull request
# https://forum.freecadweb.org/viewtopic.php?f=17&t=41117
# https://github.com/FreeCAD/FreeCAD/pull/2752
# get all used file types
# in a directory in a bash use
# find . -type f -name '*.*' | sed 's|.*\.||' | sort -u
# in Mod directory for normalized modules
# find AddonManager Arch Complete Draft Idf Fem Material OpenSCAD Show Tux -type f -name '*.*' | sed 's|.*\.||' | sort -u
# search for a specific file ending in normalized folders
# find AddonManager Arch Complete Draft Idf Fem Material OpenSCAD Show Tux -type f -name '*.emn'
# normalize the line endings of the following files
# standard files
*.bat text
*.cpp text
*.csv text
*.dox text
*.h text
*.json text
*.md text
*.py text
*.qrc text
*.sh text
*.ts text
*.txt text
*.ui text
*.xml text
*.yml text
# Fem specific files
*.dat text
*.frd text
*.geo text
*.inp text
*.sif text
*.unv text
*.vtk text
*.z88 text
# files which are human readable
# but for which it is not sure if normalize is ok
# emn
# emp
# igs
# stp
# svg
# binary files
# FCMat
# FCStd
# ods
# qm
# line endings of the modules commented will be normalized
# AddonManager/** -text
# Arch/** -text
# Complete/** -text
# Draft/** -text
# Idf/** -text
# Fem/** -text
# Material/** -text
# OpenSCAD/** -text
# Show/** -text
# Tux/** -text
# line endings of the modules NOT commented will NOT be normalized
# Be carefully changes here could affect a lot of files automatically!
Assembly/** -text
Cam/** -text
Cloud/** -text
Drawing/** -text
Image/** -text
Import/** -text
Inspection/** -text
JtReader/** -text
Measure/** -text
Mesh/** -text
MeshPart/** -text
Part/** -text
PartDesign/** -text
Path/** -text
Plot/** -text
Points/** -text
Raytracing/** -text
ReverseEngineering/** -text
Robot/** -text
Sandbox/** -text
Ship/** -text
Sketcher/** -text
Spreadsheet/** -text
Start/** -text
Surface/** -text
TechDraw/** -text
TemplatePyMod/** -text
Test/** -text
Web/** -text
# this would let git manage the file endings automatically
# to be save this will be commented
# * text=auto
# if used it has to be at beginning of all line ending commands in this file
# furthermore if used it is very important to set the file types
# which should not be normalized manually (like svg, jpg, etc)
# they should be set to binary
# These files should be ignored as it pertains to line-endings
# because they are binary or should be treated as binary
# Since auto normalize is deactivated all these could be commented too.
# needed if * text=auto is used
# *.FCStd binary
# *.jpg binary
# *.png binary
# *.pyc binary
# *.qm binary
# *.svg binary
# These files will always be checked out with CRLF, i.e. windows-style line endings. This
# really should not be needed...
# *.SomeWindowsFileExtensionThatReallyRequiresCRLFEvenInLinux eol=crlf
# use git to manually correct the file endings
# git add --renormalize .

View File

@@ -1,5 +1,5 @@
/**
\defgroup DICE3DS Dice 3DS
\ingroup EMBEDDED
\brief The Dice 3DS library provides 3DStudio files import to the Arch module
*/
/**
\defgroup DICE3DS Dice 3DS
\ingroup EMBEDDED
\brief The Dice 3DS library provides 3DStudio files import to the Arch module
*/

View File

@@ -1,34 +1,34 @@
#***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* This program is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with this program; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#***************************************************************************
# add import/export types
FreeCAD.addImportType("Industry Foundation Classes (*.ifc)","importIFC")
FreeCAD.addExportType("Industry Foundation Classes (*.ifc)","exportIFC")
FreeCAD.addImportType("Wavefront OBJ - Arch module (*.obj)","importOBJ")
FreeCAD.addExportType("Wavefront OBJ - Arch module (*.obj)","importOBJ")
FreeCAD.addExportType("WebGL file (*.html)","importWebGL")
FreeCAD.addExportType("JavaScript Object Notation (*.json)","importJSON")
FreeCAD.addImportType("Collada (*.dae)","importDAE")
FreeCAD.addExportType("Collada (*.dae)","importDAE")
FreeCAD.addImportType("3D Studio mesh (*.3ds)","import3DS")
FreeCAD.addImportType("SweetHome3D XML export (*.zip)","importSH3D")
#***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* This program is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with this program; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#***************************************************************************
# add import/export types
FreeCAD.addImportType("Industry Foundation Classes (*.ifc)","importIFC")
FreeCAD.addExportType("Industry Foundation Classes (*.ifc)","exportIFC")
FreeCAD.addImportType("Wavefront OBJ - Arch module (*.obj)","importOBJ")
FreeCAD.addExportType("Wavefront OBJ - Arch module (*.obj)","importOBJ")
FreeCAD.addExportType("WebGL file (*.html)","importWebGL")
FreeCAD.addExportType("JavaScript Object Notation (*.json)","importJSON")
FreeCAD.addImportType("Collada (*.dae)","importDAE")
FreeCAD.addExportType("Collada (*.dae)","importDAE")
FreeCAD.addImportType("3D Studio mesh (*.3ds)","import3DS")
FreeCAD.addImportType("SweetHome3D XML export (*.zip)","importSH3D")

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,152 +1,152 @@
<RCC>
<qresource>
<file>icons/Arch_Building.svg</file>
<file>icons/Arch_Floor.svg</file>
<file>icons/Arch_Cell.svg</file>
<file>icons/Arch_Wall.svg</file>
<file>icons/Arch_Site.svg</file>
<file>icons/Arch_Project.svg</file>
<file>icons/Arch_Structure.svg</file>
<file>icons/Arch_Add.svg</file>
<file>icons/Arch_Remove.svg</file>
<file>icons/Arch_MeshToShape.svg</file>
<file>icons/Arch_SplitMesh.svg</file>
<file>icons/preferences-arch.svg</file>
<file>icons/Arch_RemoveShape.svg</file>
<file>icons/Arch_SectionPlane.svg</file>
<file>icons/Arch_Window.svg</file>
<file>icons/Arch_Wall_Tree.svg</file>
<file>icons/Arch_Wall_Clone.svg</file>
<file>icons/Arch_Cell_Tree.svg</file>
<file>icons/Arch_Building_Tree.svg</file>
<file>icons/Arch_Floor_Tree.svg</file>
<file>icons/Arch_SectionPlane_Tree.svg</file>
<file>icons/Arch_Site_Tree.svg</file>
<file>icons/Arch_Project_Tree.svg</file>
<file>icons/Arch_Structure_Tree.svg</file>
<file>icons/Arch_Structure_Clone.svg</file>
<file>icons/Arch_Window_Tree.svg</file>
<file>icons/Arch_Window_Clone.svg</file>
<file>icons/Arch_Axis.svg</file>
<file>icons/Arch_Axis_Tree.svg</file>
<file>icons/Arch_Axis_System.svg</file>
<file>icons/Arch_Axis_System_Tree.svg</file>
<file>icons/Arch_Roof.svg</file>
<file>icons/Arch_Roof_Tree.svg</file>
<file>icons/Arch_CloseHoles.svg</file>
<file>icons/Arch_Check.svg</file>
<file>icons/Arch_SelectNonManifold.svg</file>
<file>icons/Arch_MergeWalls.svg</file>
<file>icons/Arch_Wall_Tree_Assembly.svg</file>
<file>icons/Arch_Fixture.svg</file>
<file>icons/Arch_Space.svg</file>
<file>icons/Arch_Space_Tree.svg</file>
<file>icons/Arch_Space_Clone.svg</file>
<file>icons/Arch_Stairs.svg</file>
<file>icons/Arch_Stairs_Tree.svg</file>
<file>icons/Arch_Rebar.svg</file>
<file>icons/Arch_Rebar_Tree.svg</file>
<file>icons/Arch_Frame.svg</file>
<file>icons/Arch_Frame_Tree.svg</file>
<file>icons/Arch_Panel.svg</file>
<file>icons/Arch_Panel_Tree.svg</file>
<file>icons/Arch_Panel_Clone.svg</file>
<file>icons/Arch_Panel_Cut.svg</file>
<file>icons/Arch_Panel_Sheet.svg</file>
<file>icons/Arch_Equipment.svg</file>
<file>icons/Arch_Equipment_Tree.svg</file>
<file>icons/Arch_Equipment_Clone.svg</file>
<file>icons/Arch_Survey.svg</file>
<file>icons/Arch_3Views.svg</file>
<file>icons/IFC.svg</file>
<file>icons/Arch_StructuralSystem.svg</file>
<file>icons/Arch_StructuralSystem_Tree.svg</file>
<file>icons/Arch_ToggleIfcBrepFlag.svg</file>
<file>icons/Arch_CutPlane.svg</file>
<file>icons/Arch_Bimserver.svg</file>
<file>icons/Git.svg</file>
<file>icons/Arch_Component.svg</file>
<file>icons/Arch_Component_Clone.svg</file>
<file>icons/Arch_Subcomponent.svg</file>
<file>icons/Arch_Material.svg</file>
<file>icons/Arch_Material_Group.svg</file>
<file>icons/Arch_Material_Multi.svg</file>
<file>icons/Arch_Schedule.svg</file>
<file>icons/ArchWorkbench.svg</file>
<file>icons/Arch_Fence.svg</file>
<file>icons/Arch_Fence_Tree.svg</file>
<file>ui/preferences-arch.ui</file>
<file>ui/preferences-archdefaults.ui</file>
<file>ui/preferences-ifc.ui</file>
<file>ui/preferences-dae.ui</file>
<file>ui/ArchMaterial.ui</file>
<file>ui/ArchMultiMaterial.ui</file>
<file>ui/ArchSchedule.ui</file>
<file>icons/Arch_Pipe.svg</file>
<file>icons/Arch_Pipe_Tree.svg</file>
<file>icons/Arch_PipeConnector.svg</file>
<file>icons/Arch_ToggleSubs.svg</file>
<file>icons/Arch_Nest.svg</file>
<file>icons/Arch_Grid.svg</file>
<file>icons/Arch_BuildingPart.svg</file>
<file>icons/Arch_BuildingPart_Tree.svg</file>
<file>icons/Arch_Profile.svg</file>
<file>icons/Arch_Reference.svg</file>
<file>ui/ParametersWindowDouble.svg</file>
<file>ui/ParametersWindowSimple.svg</file>
<file>ui/ParametersWindowFixed.svg</file>
<file>ui/ParametersWindowStash.svg</file>
<file>ui/ParametersDoorSimple.svg</file>
<file>ui/ParametersDoorGlass.svg</file>
<file>ui/ParametersBeam.svg</file>
<file>ui/ParametersPillar.svg</file>
<file>ui/ParametersDent.svg</file>
<file>ui/ParametersPanel.svg</file>
<file>ui/ParametersSlab.svg</file>
<file>ui/ParametersIbeam.svg</file>
<file>ui/ParametersStairs.svg</file>
<file>ui/BimServerTaskPanel.ui</file>
<file>ui/GitTaskPanel.ui</file>
<file>ui/DialogBimServerLogin.ui</file>
<file>ui/DialogDisplayText.ui</file>
<file>ui/ArchNest.ui</file>
<file>ui/DialogIfcProperties.ui</file>
<file>translations/Arch_af.qm</file>
<file>translations/Arch_de.qm</file>
<file>translations/Arch_fi.qm</file>
<file>translations/Arch_fr.qm</file>
<file>translations/Arch_it.qm</file>
<file>translations/Arch_nl.qm</file>
<file>translations/Arch_no.qm</file>
<file>translations/Arch_ru.qm</file>
<file>translations/Arch_uk.qm</file>
<file>translations/Arch_pl.qm</file>
<file>translations/Arch_hr.qm</file>
<file>translations/Arch_ja.qm</file>
<file>translations/Arch_hu.qm</file>
<file>translations/Arch_tr.qm</file>
<file>translations/Arch_sv-SE.qm</file>
<file>translations/Arch_zh-TW.qm</file>
<file>translations/Arch_pt-BR.qm</file>
<file>translations/Arch_cs.qm</file>
<file>translations/Arch_sk.qm</file>
<file>translations/Arch_es-ES.qm</file>
<file>translations/Arch_zh-CN.qm</file>
<file>translations/Arch_ro.qm</file>
<file>translations/Arch_pt-PT.qm</file>
<file>translations/Arch_sr.qm</file>
<file>translations/Arch_el.qm</file>
<file>translations/Arch_sl.qm</file>
<file>translations/Arch_eu.qm</file>
<file>translations/Arch_ca.qm</file>
<file>translations/Arch_gl.qm</file>
<file>translations/Arch_kab.qm</file>
<file>translations/Arch_ko.qm</file>
<file>translations/Arch_fil.qm</file>
<file>translations/Arch_id.qm</file>
<file>translations/Arch_lt.qm</file>
<file>translations/Arch_val-ES.qm</file>
<file>translations/Arch_ar.qm</file>
<file>translations/Arch_vi.qm</file>
</qresource>
</RCC>
<RCC>
<qresource>
<file>icons/Arch_Building.svg</file>
<file>icons/Arch_Floor.svg</file>
<file>icons/Arch_Cell.svg</file>
<file>icons/Arch_Wall.svg</file>
<file>icons/Arch_Site.svg</file>
<file>icons/Arch_Project.svg</file>
<file>icons/Arch_Structure.svg</file>
<file>icons/Arch_Add.svg</file>
<file>icons/Arch_Remove.svg</file>
<file>icons/Arch_MeshToShape.svg</file>
<file>icons/Arch_SplitMesh.svg</file>
<file>icons/preferences-arch.svg</file>
<file>icons/Arch_RemoveShape.svg</file>
<file>icons/Arch_SectionPlane.svg</file>
<file>icons/Arch_Window.svg</file>
<file>icons/Arch_Wall_Tree.svg</file>
<file>icons/Arch_Wall_Clone.svg</file>
<file>icons/Arch_Cell_Tree.svg</file>
<file>icons/Arch_Building_Tree.svg</file>
<file>icons/Arch_Floor_Tree.svg</file>
<file>icons/Arch_SectionPlane_Tree.svg</file>
<file>icons/Arch_Site_Tree.svg</file>
<file>icons/Arch_Project_Tree.svg</file>
<file>icons/Arch_Structure_Tree.svg</file>
<file>icons/Arch_Structure_Clone.svg</file>
<file>icons/Arch_Window_Tree.svg</file>
<file>icons/Arch_Window_Clone.svg</file>
<file>icons/Arch_Axis.svg</file>
<file>icons/Arch_Axis_Tree.svg</file>
<file>icons/Arch_Axis_System.svg</file>
<file>icons/Arch_Axis_System_Tree.svg</file>
<file>icons/Arch_Roof.svg</file>
<file>icons/Arch_Roof_Tree.svg</file>
<file>icons/Arch_CloseHoles.svg</file>
<file>icons/Arch_Check.svg</file>
<file>icons/Arch_SelectNonManifold.svg</file>
<file>icons/Arch_MergeWalls.svg</file>
<file>icons/Arch_Wall_Tree_Assembly.svg</file>
<file>icons/Arch_Fixture.svg</file>
<file>icons/Arch_Space.svg</file>
<file>icons/Arch_Space_Tree.svg</file>
<file>icons/Arch_Space_Clone.svg</file>
<file>icons/Arch_Stairs.svg</file>
<file>icons/Arch_Stairs_Tree.svg</file>
<file>icons/Arch_Rebar.svg</file>
<file>icons/Arch_Rebar_Tree.svg</file>
<file>icons/Arch_Frame.svg</file>
<file>icons/Arch_Frame_Tree.svg</file>
<file>icons/Arch_Panel.svg</file>
<file>icons/Arch_Panel_Tree.svg</file>
<file>icons/Arch_Panel_Clone.svg</file>
<file>icons/Arch_Panel_Cut.svg</file>
<file>icons/Arch_Panel_Sheet.svg</file>
<file>icons/Arch_Equipment.svg</file>
<file>icons/Arch_Equipment_Tree.svg</file>
<file>icons/Arch_Equipment_Clone.svg</file>
<file>icons/Arch_Survey.svg</file>
<file>icons/Arch_3Views.svg</file>
<file>icons/IFC.svg</file>
<file>icons/Arch_StructuralSystem.svg</file>
<file>icons/Arch_StructuralSystem_Tree.svg</file>
<file>icons/Arch_ToggleIfcBrepFlag.svg</file>
<file>icons/Arch_CutPlane.svg</file>
<file>icons/Arch_Bimserver.svg</file>
<file>icons/Git.svg</file>
<file>icons/Arch_Component.svg</file>
<file>icons/Arch_Component_Clone.svg</file>
<file>icons/Arch_Subcomponent.svg</file>
<file>icons/Arch_Material.svg</file>
<file>icons/Arch_Material_Group.svg</file>
<file>icons/Arch_Material_Multi.svg</file>
<file>icons/Arch_Schedule.svg</file>
<file>icons/ArchWorkbench.svg</file>
<file>icons/Arch_Fence.svg</file>
<file>icons/Arch_Fence_Tree.svg</file>
<file>ui/preferences-arch.ui</file>
<file>ui/preferences-archdefaults.ui</file>
<file>ui/preferences-ifc.ui</file>
<file>ui/preferences-dae.ui</file>
<file>ui/ArchMaterial.ui</file>
<file>ui/ArchMultiMaterial.ui</file>
<file>ui/ArchSchedule.ui</file>
<file>icons/Arch_Pipe.svg</file>
<file>icons/Arch_Pipe_Tree.svg</file>
<file>icons/Arch_PipeConnector.svg</file>
<file>icons/Arch_ToggleSubs.svg</file>
<file>icons/Arch_Nest.svg</file>
<file>icons/Arch_Grid.svg</file>
<file>icons/Arch_BuildingPart.svg</file>
<file>icons/Arch_BuildingPart_Tree.svg</file>
<file>icons/Arch_Profile.svg</file>
<file>icons/Arch_Reference.svg</file>
<file>ui/ParametersWindowDouble.svg</file>
<file>ui/ParametersWindowSimple.svg</file>
<file>ui/ParametersWindowFixed.svg</file>
<file>ui/ParametersWindowStash.svg</file>
<file>ui/ParametersDoorSimple.svg</file>
<file>ui/ParametersDoorGlass.svg</file>
<file>ui/ParametersBeam.svg</file>
<file>ui/ParametersPillar.svg</file>
<file>ui/ParametersDent.svg</file>
<file>ui/ParametersPanel.svg</file>
<file>ui/ParametersSlab.svg</file>
<file>ui/ParametersIbeam.svg</file>
<file>ui/ParametersStairs.svg</file>
<file>ui/BimServerTaskPanel.ui</file>
<file>ui/GitTaskPanel.ui</file>
<file>ui/DialogBimServerLogin.ui</file>
<file>ui/DialogDisplayText.ui</file>
<file>ui/ArchNest.ui</file>
<file>ui/DialogIfcProperties.ui</file>
<file>translations/Arch_af.qm</file>
<file>translations/Arch_de.qm</file>
<file>translations/Arch_fi.qm</file>
<file>translations/Arch_fr.qm</file>
<file>translations/Arch_it.qm</file>
<file>translations/Arch_nl.qm</file>
<file>translations/Arch_no.qm</file>
<file>translations/Arch_ru.qm</file>
<file>translations/Arch_uk.qm</file>
<file>translations/Arch_pl.qm</file>
<file>translations/Arch_hr.qm</file>
<file>translations/Arch_ja.qm</file>
<file>translations/Arch_hu.qm</file>
<file>translations/Arch_tr.qm</file>
<file>translations/Arch_sv-SE.qm</file>
<file>translations/Arch_zh-TW.qm</file>
<file>translations/Arch_pt-BR.qm</file>
<file>translations/Arch_cs.qm</file>
<file>translations/Arch_sk.qm</file>
<file>translations/Arch_es-ES.qm</file>
<file>translations/Arch_zh-CN.qm</file>
<file>translations/Arch_ro.qm</file>
<file>translations/Arch_pt-PT.qm</file>
<file>translations/Arch_sr.qm</file>
<file>translations/Arch_el.qm</file>
<file>translations/Arch_sl.qm</file>
<file>translations/Arch_eu.qm</file>
<file>translations/Arch_ca.qm</file>
<file>translations/Arch_gl.qm</file>
<file>translations/Arch_kab.qm</file>
<file>translations/Arch_ko.qm</file>
<file>translations/Arch_fil.qm</file>
<file>translations/Arch_id.qm</file>
<file>translations/Arch_lt.qm</file>
<file>translations/Arch_val-ES.qm</file>
<file>translations/Arch_ar.qm</file>
<file>translations/Arch_vi.qm</file>
</qresource>
</RCC>

View File

@@ -1,3 +1,3 @@
/** \defgroup ARCH Arch
* \ingroup PYTHONWORKBENCHES */
/** \defgroup ARCH Arch
* \ingroup PYTHONWORKBENCHES */

View File

@@ -972,7 +972,8 @@ def export(exportList,filename,colors=None,preferences=None):
if not(Draft.getType(FreeCAD.ActiveDocument.getObject(k)) in ["Site","Building","Floor","BuildingPart"]):
untreated.append(v)
elif Draft.getType(FreeCAD.ActiveDocument.getObject(k)) == "BuildingPart":
if not(FreeCAD.ActiveDocument.getObject(k).IfcType in ["Building","Building Storey","Site","Space","Undefined"]):
if not(FreeCAD.ActiveDocument.getObject(k).IfcType in ["Building","Building Storey","Site","Space"]):
# if ifc type is "Undefined" the object is added to untreated
untreated.append(v)
if untreated:
if not defaulthost:

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +1,27 @@
# FreeCAD init script of the Complete module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
# FreeCAD init script of the Complete module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/

View File

@@ -1,46 +1,46 @@
# Complete gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
class CompleteWorkbench(Workbench):
"Complete workbench object"
def __init__(self):
self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/Complete/Resources/icons/CompleteWorkbench.svg"
self.__class__.MenuText = "Complete"
self.__class__.ToolTip = "Complete workbench"
def Initialize(self):
pass
def GetClassName(self):
return "Gui::PythonWorkbench"
Gui.addWorkbench(CompleteWorkbench())
# Complete gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
class CompleteWorkbench(Workbench):
"Complete workbench object"
def __init__(self):
self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/Complete/Resources/icons/CompleteWorkbench.svg"
self.__class__.MenuText = "Complete"
self.__class__.ToolTip = "Complete workbench"
def Initialize(self):
pass
def GetClassName(self):
return "Gui::PythonWorkbench"
Gui.addWorkbench(CompleteWorkbench())

View File

@@ -1,51 +1,51 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
namespace DraftUtils {
extern PyObject* initModule();
}
/* Python entry */
PyMOD_INIT_FUNC(DraftUtils)
{
// load dependent module
try {
Base::Interpreter().loadModule("Part");
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
}
PyObject* mod = DraftUtils::initModule();
Base::Console().Log("Loading DraftUtils module... done\n");
PyMOD_Return(mod);
}
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
namespace DraftUtils {
extern PyObject* initModule();
}
/* Python entry */
PyMOD_INIT_FUNC(DraftUtils)
{
// load dependent module
try {
Base::Interpreter().loadModule("Part");
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
}
PyObject* mod = DraftUtils::initModule();
Base::Console().Log("Loading DraftUtils module... done\n");
PyMOD_Return(mod);
}

View File

@@ -1,100 +1,100 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
#include <Base/Console.h>
#include <Base/VectorPy.h>
#include <Base/FileInfo.h>
#include <Base/Interpreter.h>
#include <App/Document.h>
#include <App/DocumentObjectPy.h>
#include <App/Application.h>
#include "DraftDxf.h"
namespace DraftUtils {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("DraftUtils")
{
add_varargs_method("readDXF",&Module::readDXF,
"readDXF(filename,[document,ignore_errors]): Imports a DXF file into the given document. ignore_errors is True by default."
);
initialize("The DraftUtils module contains utility functions for the Draft module."); // register with Python
}
virtual ~Module() {}
private:
Py::Object readDXF(const Py::Tuple& args)
{
Base::Console().Warning("DraftUtils.readDXF is deprecated. Use Import.readDxf instead.\n");
char* Name;
const char* DocName=0;
bool IgnoreErrors=true;
if (!PyArg_ParseTuple(args.ptr(), "et|sb","utf-8",&Name,&DocName,&IgnoreErrors))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
Base::FileInfo file(EncodedName.c_str());
if (!file.exists())
throw Py::RuntimeError("File doesn't exist");
App::Document *pcDoc;
if (DocName)
pcDoc = App::GetApplication().getDocument(DocName);
else
pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument(DocName);
try {
// read the DXF file
DraftDxfRead dxf_file(EncodedName,pcDoc);
dxf_file.DoRead(IgnoreErrors);
pcDoc->recompute();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
return Py::None();
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
} // namespace DraftUtils
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
#include <Base/Console.h>
#include <Base/VectorPy.h>
#include <Base/FileInfo.h>
#include <Base/Interpreter.h>
#include <App/Document.h>
#include <App/DocumentObjectPy.h>
#include <App/Application.h>
#include "DraftDxf.h"
namespace DraftUtils {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("DraftUtils")
{
add_varargs_method("readDXF",&Module::readDXF,
"readDXF(filename,[document,ignore_errors]): Imports a DXF file into the given document. ignore_errors is True by default."
);
initialize("The DraftUtils module contains utility functions for the Draft module."); // register with Python
}
virtual ~Module() {}
private:
Py::Object readDXF(const Py::Tuple& args)
{
Base::Console().Warning("DraftUtils.readDXF is deprecated. Use Import.readDxf instead.\n");
char* Name;
const char* DocName=0;
bool IgnoreErrors=true;
if (!PyArg_ParseTuple(args.ptr(), "et|sb","utf-8",&Name,&DocName,&IgnoreErrors))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
Base::FileInfo file(EncodedName.c_str());
if (!file.exists())
throw Py::RuntimeError("File doesn't exist");
App::Document *pcDoc;
if (DocName)
pcDoc = App::GetApplication().getDocument(DocName);
else
pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument(DocName);
try {
// read the DXF file
DraftDxfRead dxf_file(EncodedName,pcDoc);
dxf_file.DoRead(IgnoreErrors);
pcDoc->recompute();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
return Py::None();
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
} // namespace DraftUtils

View File

@@ -26,7 +26,7 @@
#include "dxf.h"
#include <Mod/Part/App/TopoShape.h>
#include <App/Document.h>
#include <gp_Pnt.hxx>
#include <gp_Pnt.hxx>
namespace DraftUtils
{

View File

@@ -1,24 +1,24 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -1,62 +1,62 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAFTUTILS_PRECOMPILED_H
#define DRAFTUTILS_PRECOMPILED_H
#include <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define DraftUtilsExport __declspec(dllexport)
# define PartExport __declspec(dllexport)
# define BaseExport __declspec(dllimport)
#else // for Linux
# define DraftUtilsExport
# define PartExport
# define BaseExport
#endif
#ifdef _MSC_VER
# pragma warning(disable : 4275)
#endif
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <cctype>
#include <Python.h>
#endif // _PreComp_
#endif
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAFTUTILS_PRECOMPILED_H
#define DRAFTUTILS_PRECOMPILED_H
#include <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define DraftUtilsExport __declspec(dllexport)
# define PartExport __declspec(dllexport)
# define BaseExport __declspec(dllimport)
#else // for Linux
# define DraftUtilsExport
# define PartExport
# define BaseExport
#endif
#ifdef _MSC_VER
# pragma warning(disable : 4275)
#endif
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <cctype>
#include <Python.h>
#endif // _PreComp_
#endif

View File

@@ -1,162 +1,162 @@
// dxf.h
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include <algorithm>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
//Following is required to be defined on Ubuntu with OCC 6.3.1
#ifndef HAVE_IOSTREAM
#define HAVE_IOSTREAM
#endif
typedef int Aci_t; // AutoCAD color index
typedef enum
{
eUnspecified = 0, // Unspecified (No units)
eInches,
eFeet,
eMiles,
eMillimeters,
eCentimeters,
eMeters,
eKilometers,
eMicroinches,
eMils,
eYards,
eAngstroms,
eNanometers,
eMicrons,
eDecimeters,
eDekameters,
eHectometers,
eGigameters,
eAstronomicalUnits,
eLightYears,
eParsecs
} eDxfUnits_t;
struct SplineData
{
double norm[3];
int degree;
int knots;
int control_points;
int fit_points;
int flag;
std::list<double> starttanx;
std::list<double> starttany;
std::list<double> starttanz;
std::list<double> endtanx;
std::list<double> endtany;
std::list<double> endtanz;
std::list<double> knot;
std::list<double> weight;
std::list<double> controlx;
std::list<double> controly;
std::list<double> controlz;
std::list<double> fitx;
std::list<double> fity;
std::list<double> fitz;
};
class CDxfWrite{
private:
std::ofstream* m_ofs;
bool m_fail;
public:
CDxfWrite(const char* filepath);
~CDxfWrite();
bool Failed(){return m_fail;}
void WriteLine(const double* s, const double* e, const char* layer_name );
void WritePoint(const double*, const char*);
void WriteArc(const double* s, const double* e, const double* c, bool dir, const char* layer_name );
void WriteEllipse(const double* c, double major_radius, double minor_radius, double rotation, double start_angle, double end_angle, bool dir, const char* layer_name );
void WriteCircle(const double* c, double radius, const char* layer_name );
};
// derive a class from this and implement it's virtual functions
class CDxfRead{
private:
std::ifstream* m_ifs;
bool m_fail;
char m_str[1024];
char m_unused_line[1024];
eDxfUnits_t m_eUnits;
bool m_measurement_inch;
char m_layer_name[1024];
char m_section_name[1024];
char m_block_name[1024];
bool m_ignore_errors;
typedef std::map< std::string,Aci_t > LayerAciMap_t;
LayerAciMap_t m_layer_aci; // layer names -> layer color aci map
bool ReadUnits();
bool ReadLayer();
bool ReadLine();
bool ReadText();
bool ReadArc();
bool ReadCircle();
bool ReadEllipse();
bool ReadPoint();
bool ReadSpline();
bool ReadLwPolyLine();
bool ReadPolyLine();
bool ReadVertex(double *pVertex, bool *bulge_found, double *bulge);
void OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden);
void OnReadCircle(const double* c, double radius, bool hidden);
void OnReadEllipse(const double* c, const double* m, double ratio, double start_angle, double end_angle);
bool ReadInsert();
bool ReadDimension();
bool ReadBlockInfo();
void get_line();
void put_line(const char *value);
void DerefACI();
protected:
Aci_t m_aci; // manifest color name or 256 for layer color
public:
CDxfRead(const char* filepath); // this opens the file
~CDxfRead(); // this closes the file
bool Failed(){return m_fail;}
void DoRead(const bool ignore_errors = false); // this reads the file and calls the following functions
double mm( double value ) const;
bool IgnoreErrors() const { return(m_ignore_errors); }
virtual void OnReadLine(const double* /*s*/, const double* /*e*/, bool /*hidden*/){}
virtual void OnReadPoint(const double* /*s*/){}
virtual void OnReadText(const double* /*point*/, const double /*height*/, const char* /*text*/){}
virtual void OnReadArc(const double* /*s*/, const double* /*e*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadCircle(const double* /*s*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadEllipse(const double* /*c*/, double /*major_radius*/, double /*minor_radius*/, double /*rotation*/, double /*start_angle*/, double /*end_angle*/, bool /*dir*/){}
virtual void OnReadSpline(struct SplineData& /*sd*/){}
virtual void OnReadInsert(const double* /*point*/, const double* /*scale*/, const char* /*name*/, double /*rotation*/){}
virtual void OnReadDimension(const double* /*s*/, const double* /*e*/, const double* /*point*/, double /*rotation*/){}
virtual void AddGraphics() const { }
std::string LayerName() const;
};
// dxf.h
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include <algorithm>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
//Following is required to be defined on Ubuntu with OCC 6.3.1
#ifndef HAVE_IOSTREAM
#define HAVE_IOSTREAM
#endif
typedef int Aci_t; // AutoCAD color index
typedef enum
{
eUnspecified = 0, // Unspecified (No units)
eInches,
eFeet,
eMiles,
eMillimeters,
eCentimeters,
eMeters,
eKilometers,
eMicroinches,
eMils,
eYards,
eAngstroms,
eNanometers,
eMicrons,
eDecimeters,
eDekameters,
eHectometers,
eGigameters,
eAstronomicalUnits,
eLightYears,
eParsecs
} eDxfUnits_t;
struct SplineData
{
double norm[3];
int degree;
int knots;
int control_points;
int fit_points;
int flag;
std::list<double> starttanx;
std::list<double> starttany;
std::list<double> starttanz;
std::list<double> endtanx;
std::list<double> endtany;
std::list<double> endtanz;
std::list<double> knot;
std::list<double> weight;
std::list<double> controlx;
std::list<double> controly;
std::list<double> controlz;
std::list<double> fitx;
std::list<double> fity;
std::list<double> fitz;
};
class CDxfWrite{
private:
std::ofstream* m_ofs;
bool m_fail;
public:
CDxfWrite(const char* filepath);
~CDxfWrite();
bool Failed(){return m_fail;}
void WriteLine(const double* s, const double* e, const char* layer_name );
void WritePoint(const double*, const char*);
void WriteArc(const double* s, const double* e, const double* c, bool dir, const char* layer_name );
void WriteEllipse(const double* c, double major_radius, double minor_radius, double rotation, double start_angle, double end_angle, bool dir, const char* layer_name );
void WriteCircle(const double* c, double radius, const char* layer_name );
};
// derive a class from this and implement it's virtual functions
class CDxfRead{
private:
std::ifstream* m_ifs;
bool m_fail;
char m_str[1024];
char m_unused_line[1024];
eDxfUnits_t m_eUnits;
bool m_measurement_inch;
char m_layer_name[1024];
char m_section_name[1024];
char m_block_name[1024];
bool m_ignore_errors;
typedef std::map< std::string,Aci_t > LayerAciMap_t;
LayerAciMap_t m_layer_aci; // layer names -> layer color aci map
bool ReadUnits();
bool ReadLayer();
bool ReadLine();
bool ReadText();
bool ReadArc();
bool ReadCircle();
bool ReadEllipse();
bool ReadPoint();
bool ReadSpline();
bool ReadLwPolyLine();
bool ReadPolyLine();
bool ReadVertex(double *pVertex, bool *bulge_found, double *bulge);
void OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden);
void OnReadCircle(const double* c, double radius, bool hidden);
void OnReadEllipse(const double* c, const double* m, double ratio, double start_angle, double end_angle);
bool ReadInsert();
bool ReadDimension();
bool ReadBlockInfo();
void get_line();
void put_line(const char *value);
void DerefACI();
protected:
Aci_t m_aci; // manifest color name or 256 for layer color
public:
CDxfRead(const char* filepath); // this opens the file
~CDxfRead(); // this closes the file
bool Failed(){return m_fail;}
void DoRead(const bool ignore_errors = false); // this reads the file and calls the following functions
double mm( double value ) const;
bool IgnoreErrors() const { return(m_ignore_errors); }
virtual void OnReadLine(const double* /*s*/, const double* /*e*/, bool /*hidden*/){}
virtual void OnReadPoint(const double* /*s*/){}
virtual void OnReadText(const double* /*point*/, const double /*height*/, const char* /*text*/){}
virtual void OnReadArc(const double* /*s*/, const double* /*e*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadCircle(const double* /*s*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadEllipse(const double* /*c*/, double /*major_radius*/, double /*minor_radius*/, double /*rotation*/, double /*start_angle*/, double /*end_angle*/, bool /*dir*/){}
virtual void OnReadSpline(struct SplineData& /*sd*/){}
virtual void OnReadInsert(const double* /*point*/, const double* /*scale*/, const char* /*name*/, double /*rotation*/){}
virtual void OnReadDimension(const double* /*s*/, const double* /*e*/, const double* /*point*/, double /*rotation*/){}
virtual void AddGraphics() const { }
std::string LayerName() const;
};

View File

@@ -1,32 +1,32 @@
#***************************************************************************
#* *
#* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* This program is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with this program; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#***************************************************************************
# add Import/Export types
App.addImportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addImportType("SVG as geometry (*.svg)","importSVG")
App.addImportType("Open CAD Format (*.oca *.gcad)","importOCA")
App.addImportType("Common airfoil data (*.dat)","importAirfoilDAT")
App.addExportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addExportType("Flattened SVG (*.svg)","importSVG")
App.addExportType("Open CAD Format (*.oca)","importOCA")
App.addImportType("Autodesk DWG 2D (*.dwg)","importDWG")
App.addExportType("Autodesk DWG 2D (*.dwg)","importDWG")
#***************************************************************************
#* *
#* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* This program is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with this program; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#***************************************************************************
# add Import/Export types
App.addImportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addImportType("SVG as geometry (*.svg)","importSVG")
App.addImportType("Open CAD Format (*.oca *.gcad)","importOCA")
App.addImportType("Common airfoil data (*.dat)","importAirfoilDAT")
App.addExportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addExportType("Flattened SVG (*.svg)","importSVG")
App.addExportType("Open CAD Format (*.oca)","importOCA")
App.addImportType("Autodesk DWG 2D (*.dwg)","importDWG")
App.addExportType("Autodesk DWG 2D (*.dwg)","importDWG")

View File

@@ -1,154 +1,154 @@
<RCC>
<qresource>
<file>icons/Draft_2DShapeView.svg</file>
<file>icons/Draft_AddPoint.svg</file>
<file>icons/Draft_AddToGroup.svg</file>
<file>icons/Draft_Apply.svg</file>
<file>icons/Draft_Arc.svg</file>
<file>icons/Draft_Arc_3Points.svg</file>
<file>icons/Draft_Array.svg</file>
<file>icons/Draft_AutoGroup.svg</file>
<file>icons/Draft_AutoGroup_on.svg</file>
<file>icons/Draft_AutoGroup_off.svg</file>
<file>icons/Draft_BezCurve.svg</file>
<file>icons/Draft_BezSharpNode.svg</file>
<file>icons/Draft_BezSymNode.svg</file>
<file>icons/Draft_BezTanNode.svg</file>
<file>icons/Draft_BSpline.svg</file>
<file>icons/Draft_Circle.svg</file>
<file>icons/Draft_Clone.svg</file>
<file>icons/Draft_Construction.svg</file>
<file>icons/Draft_CubicBezCurve.svg</file>
<file>icons/Draft_Cursor.svg</file>
<file>icons/Draft_DelPoint.svg</file>
<file>icons/Draft_Dimension.svg</file>
<file>icons/Draft_Dimension_Tree.svg</file>
<file>icons/Draft_Dot.svg</file>
<file>icons/Draft_Downgrade.svg</file>
<file>icons/Draft_Draft.svg</file>
<file>icons/Draft_Draft2Sketch.svg</file>
<file>icons/Draft_Drawing.svg</file>
<file>icons/Draft_Edit.svg</file>
<file>icons/Draft_Ellipse.svg</file>
<file>icons/Draft_Facebinder.svg</file>
<file>icons/Draft_Facebinder_Provider.svg</file>
<file>icons/Draft_Fillet.svg</file>
<file>icons/Draft_Finish.svg</file>
<file>icons/Draft_FlipDimension.svg</file>
<file>icons/Draft_Grid.svg</file>
<file>icons/Draft_Heal.svg</file>
<file>icons/Draft_Join.svg</file>
<file>icons/Draft_Label.svg</file>
<file>icons/Draft_Layer.svg</file>
<file>icons/Draft_Line.svg</file>
<file>icons/Draft_LinkArray.svg</file>
<file>icons/Draft_Lock.svg</file>
<file>icons/Draft_Macro.svg</file>
<file>icons/Draft_Mirror.svg</file>
<file>icons/Draft_Move.svg</file>
<file>icons/Draft_Offset.svg</file>
<file>icons/Draft_PathArray.svg</file>
<file>icons/Draft_PathLinkArray.svg</file>
<file>icons/Draft_Point.svg</file>
<file>icons/Draft_PointArray.svg</file>
<file>icons/Draft_Polygon.svg</file>
<file>icons/Draft_Rectangle.svg</file>
<file>icons/Draft_Rotate.svg</file>
<file>icons/Draft_Scale.svg</file>
<file>icons/Draft_SelectGroup.svg</file>
<file>icons/Draft_SelectPlane.svg</file>
<file>icons/Draft_ShapeString.svg</file>
<file>icons/Draft_Slope.svg</file>
<file>icons/Draft_Snap.svg</file>
<file>icons/Draft_Split.svg</file>
<file>icons/Draft_Stretch.svg</file>
<file>icons/Draft_SubelementHighlight.svg</file>
<file>icons/Draft_SwitchMode.svg</file>
<file>icons/Draft_Text.svg</file>
<file>icons/Draft_Trimex.svg</file>
<file>icons/Draft_Upgrade.svg</file>
<file>icons/Draft_VisGroup.svg</file>
<file>icons/Draft_Wipe.svg</file>
<file>icons/Draft_Wire.svg</file>
<file>icons/Draft_WireToBSpline.svg</file>
<file>icons/DraftWorkbench.svg</file>
<file>icons/preferences-draft.svg</file>
<file>icons/Snap_Angle.svg</file>
<file>icons/Snap_Center.svg</file>
<file>icons/Snap_Dimensions.svg</file>
<file>icons/Snap_Endpoint.svg</file>
<file>icons/Snap_Extension.svg</file>
<file>icons/Snap_Grid.svg</file>
<file>icons/Snap_Intersection.svg</file>
<file>icons/Snap_Lock.svg</file>
<file>icons/Snap_Midpoint.svg</file>
<file>icons/Snap_Near.svg</file>
<file>icons/Snap_Ortho.svg</file>
<file>icons/Snap_Parallel.svg</file>
<file>icons/Snap_Perpendicular.svg</file>
<file>icons/Snap_Special.svg</file>
<file>icons/Snap_WorkingPlane.svg</file>
<file>patterns/brick01</file>
<file>patterns/concrete.svg</file>
<file>patterns/cross.svg</file>
<file>patterns/diagonal1.svg</file>
<file>patterns/diagonal2.svg</file>
<file>patterns/earth.svg</file>
<file>patterns/hbone.svg</file>
<file>patterns/line.svg</file>
<file>patterns/plus.svg</file>
<file>patterns/simple.svg</file>
<file>patterns/solid.svg</file>
<file>patterns/square.svg</file>
<file>patterns/steel.svg</file>
<file>patterns/wood.svg</file>
<file>patterns/woodgrain.svg</file>
<file>translations/Draft_af.qm</file>
<file>translations/Draft_ar.qm</file>
<file>translations/Draft_ca.qm</file>
<file>translations/Draft_cs.qm</file>
<file>translations/Draft_de.qm</file>
<file>translations/Draft_el.qm</file>
<file>translations/Draft_es-ES.qm</file>
<file>translations/Draft_eu.qm</file>
<file>translations/Draft_fi.qm</file>
<file>translations/Draft_fil.qm</file>
<file>translations/Draft_fr.qm</file>
<file>translations/Draft_gl.qm</file>
<file>translations/Draft_hr.qm</file>
<file>translations/Draft_hu.qm</file>
<file>translations/Draft_id.qm</file>
<file>translations/Draft_it.qm</file>
<file>translations/Draft_ja.qm</file>
<file>translations/Draft_kab.qm</file>
<file>translations/Draft_ko.qm</file>
<file>translations/Draft_lt.qm</file>
<file>translations/Draft_nl.qm</file>
<file>translations/Draft_no.qm</file>
<file>translations/Draft_pl.qm</file>
<file>translations/Draft_pt-BR.qm</file>
<file>translations/Draft_pt-PT.qm</file>
<file>translations/Draft_ro.qm</file>
<file>translations/Draft_ru.qm</file>
<file>translations/Draft_sk.qm</file>
<file>translations/Draft_sl.qm</file>
<file>translations/Draft_sr.qm</file>
<file>translations/Draft_sv-SE.qm</file>
<file>translations/Draft_tr.qm</file>
<file>translations/Draft_uk.qm</file>
<file>translations/Draft_val-ES.qm</file>
<file>translations/Draft_vi.qm</file>
<file>translations/Draft_zh-CN.qm</file>
<file>translations/Draft_zh-TW.qm</file>
<file>ui/preferences-draft.ui</file>
<file>ui/preferences-draftsnap.ui</file>
<file>ui/preferences-drafttexts.ui</file>
<file>ui/preferences-draftvisual.ui</file>
<file>ui/preferences-dwg.ui</file>
<file>ui/preferences-dxf.ui</file>
<file>ui/preferences-oca.ui</file>
<file>ui/preferences-svg.ui</file>
<file>ui/TaskSelectPlane.ui</file>
<file>ui/TaskShapeString.ui</file>
</qresource>
</RCC>
<RCC>
<qresource>
<file>icons/Draft_2DShapeView.svg</file>
<file>icons/Draft_AddPoint.svg</file>
<file>icons/Draft_AddToGroup.svg</file>
<file>icons/Draft_Apply.svg</file>
<file>icons/Draft_Arc.svg</file>
<file>icons/Draft_Arc_3Points.svg</file>
<file>icons/Draft_Array.svg</file>
<file>icons/Draft_AutoGroup.svg</file>
<file>icons/Draft_AutoGroup_on.svg</file>
<file>icons/Draft_AutoGroup_off.svg</file>
<file>icons/Draft_BezCurve.svg</file>
<file>icons/Draft_BezSharpNode.svg</file>
<file>icons/Draft_BezSymNode.svg</file>
<file>icons/Draft_BezTanNode.svg</file>
<file>icons/Draft_BSpline.svg</file>
<file>icons/Draft_Circle.svg</file>
<file>icons/Draft_Clone.svg</file>
<file>icons/Draft_Construction.svg</file>
<file>icons/Draft_CubicBezCurve.svg</file>
<file>icons/Draft_Cursor.svg</file>
<file>icons/Draft_DelPoint.svg</file>
<file>icons/Draft_Dimension.svg</file>
<file>icons/Draft_Dimension_Tree.svg</file>
<file>icons/Draft_Dot.svg</file>
<file>icons/Draft_Downgrade.svg</file>
<file>icons/Draft_Draft.svg</file>
<file>icons/Draft_Draft2Sketch.svg</file>
<file>icons/Draft_Drawing.svg</file>
<file>icons/Draft_Edit.svg</file>
<file>icons/Draft_Ellipse.svg</file>
<file>icons/Draft_Facebinder.svg</file>
<file>icons/Draft_Facebinder_Provider.svg</file>
<file>icons/Draft_Fillet.svg</file>
<file>icons/Draft_Finish.svg</file>
<file>icons/Draft_FlipDimension.svg</file>
<file>icons/Draft_Grid.svg</file>
<file>icons/Draft_Heal.svg</file>
<file>icons/Draft_Join.svg</file>
<file>icons/Draft_Label.svg</file>
<file>icons/Draft_Layer.svg</file>
<file>icons/Draft_Line.svg</file>
<file>icons/Draft_LinkArray.svg</file>
<file>icons/Draft_Lock.svg</file>
<file>icons/Draft_Macro.svg</file>
<file>icons/Draft_Mirror.svg</file>
<file>icons/Draft_Move.svg</file>
<file>icons/Draft_Offset.svg</file>
<file>icons/Draft_PathArray.svg</file>
<file>icons/Draft_PathLinkArray.svg</file>
<file>icons/Draft_Point.svg</file>
<file>icons/Draft_PointArray.svg</file>
<file>icons/Draft_Polygon.svg</file>
<file>icons/Draft_Rectangle.svg</file>
<file>icons/Draft_Rotate.svg</file>
<file>icons/Draft_Scale.svg</file>
<file>icons/Draft_SelectGroup.svg</file>
<file>icons/Draft_SelectPlane.svg</file>
<file>icons/Draft_ShapeString.svg</file>
<file>icons/Draft_Slope.svg</file>
<file>icons/Draft_Snap.svg</file>
<file>icons/Draft_Split.svg</file>
<file>icons/Draft_Stretch.svg</file>
<file>icons/Draft_SubelementHighlight.svg</file>
<file>icons/Draft_SwitchMode.svg</file>
<file>icons/Draft_Text.svg</file>
<file>icons/Draft_Trimex.svg</file>
<file>icons/Draft_Upgrade.svg</file>
<file>icons/Draft_VisGroup.svg</file>
<file>icons/Draft_Wipe.svg</file>
<file>icons/Draft_Wire.svg</file>
<file>icons/Draft_WireToBSpline.svg</file>
<file>icons/DraftWorkbench.svg</file>
<file>icons/preferences-draft.svg</file>
<file>icons/Snap_Angle.svg</file>
<file>icons/Snap_Center.svg</file>
<file>icons/Snap_Dimensions.svg</file>
<file>icons/Snap_Endpoint.svg</file>
<file>icons/Snap_Extension.svg</file>
<file>icons/Snap_Grid.svg</file>
<file>icons/Snap_Intersection.svg</file>
<file>icons/Snap_Lock.svg</file>
<file>icons/Snap_Midpoint.svg</file>
<file>icons/Snap_Near.svg</file>
<file>icons/Snap_Ortho.svg</file>
<file>icons/Snap_Parallel.svg</file>
<file>icons/Snap_Perpendicular.svg</file>
<file>icons/Snap_Special.svg</file>
<file>icons/Snap_WorkingPlane.svg</file>
<file>patterns/brick01</file>
<file>patterns/concrete.svg</file>
<file>patterns/cross.svg</file>
<file>patterns/diagonal1.svg</file>
<file>patterns/diagonal2.svg</file>
<file>patterns/earth.svg</file>
<file>patterns/hbone.svg</file>
<file>patterns/line.svg</file>
<file>patterns/plus.svg</file>
<file>patterns/simple.svg</file>
<file>patterns/solid.svg</file>
<file>patterns/square.svg</file>
<file>patterns/steel.svg</file>
<file>patterns/wood.svg</file>
<file>patterns/woodgrain.svg</file>
<file>translations/Draft_af.qm</file>
<file>translations/Draft_ar.qm</file>
<file>translations/Draft_ca.qm</file>
<file>translations/Draft_cs.qm</file>
<file>translations/Draft_de.qm</file>
<file>translations/Draft_el.qm</file>
<file>translations/Draft_es-ES.qm</file>
<file>translations/Draft_eu.qm</file>
<file>translations/Draft_fi.qm</file>
<file>translations/Draft_fil.qm</file>
<file>translations/Draft_fr.qm</file>
<file>translations/Draft_gl.qm</file>
<file>translations/Draft_hr.qm</file>
<file>translations/Draft_hu.qm</file>
<file>translations/Draft_id.qm</file>
<file>translations/Draft_it.qm</file>
<file>translations/Draft_ja.qm</file>
<file>translations/Draft_kab.qm</file>
<file>translations/Draft_ko.qm</file>
<file>translations/Draft_lt.qm</file>
<file>translations/Draft_nl.qm</file>
<file>translations/Draft_no.qm</file>
<file>translations/Draft_pl.qm</file>
<file>translations/Draft_pt-BR.qm</file>
<file>translations/Draft_pt-PT.qm</file>
<file>translations/Draft_ro.qm</file>
<file>translations/Draft_ru.qm</file>
<file>translations/Draft_sk.qm</file>
<file>translations/Draft_sl.qm</file>
<file>translations/Draft_sr.qm</file>
<file>translations/Draft_sv-SE.qm</file>
<file>translations/Draft_tr.qm</file>
<file>translations/Draft_uk.qm</file>
<file>translations/Draft_val-ES.qm</file>
<file>translations/Draft_vi.qm</file>
<file>translations/Draft_zh-CN.qm</file>
<file>translations/Draft_zh-TW.qm</file>
<file>ui/preferences-draft.ui</file>
<file>ui/preferences-draftsnap.ui</file>
<file>ui/preferences-drafttexts.ui</file>
<file>ui/preferences-draftvisual.ui</file>
<file>ui/preferences-dwg.ui</file>
<file>ui/preferences-dxf.ui</file>
<file>ui/preferences-oca.ui</file>
<file>ui/preferences-svg.ui</file>
<file>ui/TaskSelectPlane.ui</file>
<file>ui/TaskShapeString.ui</file>
</qresource>
</RCC>

View File

@@ -1,5 +1,5 @@
/** \defgroup DRAFT Draft
* \ingroup PYTHONWORKBENCHES
* \brief Basic 2D drawing tools and other generic tools
*/
/** \defgroup DRAFT Draft
* \ingroup PYTHONWORKBENCHES
* \brief Basic 2D drawing tools and other generic tools
*/

View File

@@ -1,62 +0,0 @@
# In case people don't have core.autocrlf set, this will manage the default line-ending
# behaviour for all files recursively
# * text=auto
# to be save this will be commented
# for more information see forum topic and pull request
# https://github.com/FreeCAD/FreeCAD/pull/2752
# https://forum.freecadweb.org/viewtopic.php?f=17&t=41117
# get all used file types
# in a directory in a bash use
# find . -type f -name '*.*' | sed 's|.*\.||' | sort -u
# add all of them either to text or binary
# Explicitly declare which files we wish to always normalize line-endings on
# standard endings
*.bat text
*.cpp text
*.csv text
*.h text
*.md text
*.py text
*.qrc text
*.ts text
*.txt text
*.ui text
*.xml text
*.yml text
# Fem specific endings
*.dat text
*.frd text
*.geo text
*.inp text
*.sif text
*.unv text
*.vtk text
*.z88 text
# These files will always be checked out with CRLF, i.e. windows-style line endings. This
# really should not be needed...
# *.SomeWindowsFileExtensionThatReallyRequiresCRLFEvenInLinux eol=crlf
# These files should be ignored as it pertains to line-endings, because they are binary.
# Since auto normalize is deactivated all these could be commented too.
# *.dox binary
# *.FCStd binary
# *.jpg binary
# *.png binary
# *.pyc binary
# *.qm binary
# *.svg binary
# use git to manually correct the file endings
# git add --renormalize .

View File

@@ -1,6 +1,6 @@
(c) 2010 Milos Koutny (milos.koutny@gmail.com)
All parts in this directory are supported by Milos Koutny
and licensed under:
Creative Commons Attribution Share Alike
(c) 2010 Milos Koutny (milos.koutny@gmail.com)
All parts in this directory are supported by Milos Koutny
and licensed under:
Creative Commons Attribution Share Alike

View File

@@ -1,35 +1,35 @@
"FOOTPRINT" "STEP FILE"
"SOT23-R" "SOT23.igs"
"SMD_C_0805-R" "0805_SMD.stp"
"SMD_C_1210-R" "1210_SMD.stp"
"SMD_R_1206-R" "1206_SMD.stp"
"SMD_C_0603-R" "0603_SMD.stp"
"SMD_R_0603-R" "0603_SMD.stp"
"MINISMDC-1812-R" "1812_SMD.stp"
"SMD_C_2225-R" "2225_SMD.stp"
"SMD_R_2512-R" "2512_SMD.stp"
"1812PS" "1812_SMD.stp"
"TSSOP8_065M-R" "TSS0P_8.stp"
"MSOP10E_LT" "MSOP_10.stp"
"TCMT11XX" "TCMT1107_4.stp"
"SMB-TB" "SMB_DO_214AA.stp"
"SOT404-GDS-R" "SOT404.igs"
"SOT428-A1-A2C-R" "SOT428_DPAK.stp"
"SOT96-1-R" "SOT_96.stp"
"SOT323-BEC-R" "SOT_323_3.stp"
"SOD523-R" "SOD_523.stp"
"SMC" "SMC_DO_214AB.stp"
"SOD523-R" "SOD_523.stp"
"TSM-104-01-L-DV" "TSM_104_01_L_DV_A.stp"
"TSM-103-01-L-DV-A" "TSM_103_01_L_DV_A.stp"
"SOD323-R" "SOD_323.igs"
"VC0603-R" "VC0603_SMD.stp"
"RLF12545" "RLF_12545.igs"
"CAPAE830X1050" "CAP_50SGV_8_10.stp"
"RLF7030-R" "RLF_7030.stp"
"EPS_B66285E" "EPL22_6_16.stp"
"EPS_B66285I" "I22_2_5_16.stp"
"FOOTPRINT" "STEP FILE"
"SOT23-R" "SOT23.igs"
"SMD_C_0805-R" "0805_SMD.stp"
"SMD_C_1210-R" "1210_SMD.stp"
"SMD_R_1206-R" "1206_SMD.stp"
"SMD_C_0603-R" "0603_SMD.stp"
"SMD_R_0603-R" "0603_SMD.stp"
"MINISMDC-1812-R" "1812_SMD.stp"
"SMD_C_2225-R" "2225_SMD.stp"
"SMD_R_2512-R" "2512_SMD.stp"
"1812PS" "1812_SMD.stp"
"TSSOP8_065M-R" "TSS0P_8.stp"
"MSOP10E_LT" "MSOP_10.stp"
"TCMT11XX" "TCMT1107_4.stp"
"SMB-TB" "SMB_DO_214AA.stp"
"SOT404-GDS-R" "SOT404.igs"
"SOT428-A1-A2C-R" "SOT428_DPAK.stp"
"SOT96-1-R" "SOT_96.stp"
"SOT323-BEC-R" "SOT_323_3.stp"
"SOD523-R" "SOD_523.stp"
"SMC" "SMC_DO_214AB.stp"
"SOD523-R" "SOD_523.stp"
"TSM-104-01-L-DV" "TSM_104_01_L_DV_A.stp"
"TSM-103-01-L-DV-A" "TSM_103_01_L_DV_A.stp"
"SOD323-R" "SOD_323.igs"
"VC0603-R" "VC0603_SMD.stp"
"RLF12545" "RLF_12545.igs"
"CAPAE830X1050" "CAP_50SGV_8_10.stp"
"RLF7030-R" "RLF_7030.stp"
"EPS_B66285E" "EPL22_6_16.stp"
"EPS_B66285I" "I22_2_5_16.stp"
Can't render this file because it contains an unexpected character in line 1 and column 11.

View File

@@ -1,36 +1,36 @@
# Idf init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
# two options for IDF added by Milos Koutny (12-Feb-2010)
FreeCAD.addImportType("IDF emn file File Type (*.emn)","Idf")
#FreeCAD.addImportType("IDF emp File Type (*.emp)","Import_Emp")
# Idf init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
# two options for IDF added by Milos Koutny (12-Feb-2010)
FreeCAD.addImportType("IDF emn file File Type (*.emn)","Idf")
#FreeCAD.addImportType("IDF emp File Type (*.emp)","Import_Emp")

View File

@@ -1,37 +1,37 @@
# FreeCAD init script of the OpenSCAD module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
import FreeCAD,os
FreeCAD.addImportType("OpenSCAD CSG Format (*.csg)","importCSG")
param = FreeCAD.ParamGet(\
"User parameter:BaseApp/Preferences/Mod/OpenSCAD")
openscadfilename = param.GetString('openscadexecutable')
openscadbin = openscadfilename and os.path.isfile(openscadfilename)
if openscadbin:
FreeCAD.addImportType("OpenSCAD Format (*.scad)","importCSG")
FreeCAD.addExportType("OpenSCAD CSG Format (*.csg)","exportCSG")
FreeCAD.addExportType("OpenSCAD Format (*.scad)","exportCSG")
# FreeCAD init script of the OpenSCAD module
# (c) 2001 Juergen Riegel
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* FreeCAD is distributed in the hope that it will be useful, *
#* but WITHOUT ANY WARRANTY; without even the implied warranty of *
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
#* GNU Lesser General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library General Public *
#* License along with FreeCAD; if not, write to the Free Software *
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
#* USA *
#* *
#* Juergen Riegel 2002 *
#***************************************************************************/
import FreeCAD,os
FreeCAD.addImportType("OpenSCAD CSG Format (*.csg)","importCSG")
param = FreeCAD.ParamGet(\
"User parameter:BaseApp/Preferences/Mod/OpenSCAD")
openscadfilename = param.GetString('openscadexecutable')
openscadbin = openscadfilename and os.path.isfile(openscadfilename)
if openscadbin:
FreeCAD.addImportType("OpenSCAD Format (*.scad)","importCSG")
FreeCAD.addExportType("OpenSCAD CSG Format (*.csg)","exportCSG")
FreeCAD.addExportType("OpenSCAD Format (*.scad)","exportCSG")

View File

@@ -1,5 +1,5 @@
/** \defgroup OPENSCAD OpenSCAD
* \ingroup PYTHONWORKBENCHES
* \brief Interface with OpenSCAD
*/
/** \defgroup OPENSCAD OpenSCAD
* \ingroup PYTHONWORKBENCHES
* \brief Interface with OpenSCAD
*/

View File

@@ -1,54 +1,54 @@
<RCC>
<qresource>
<file>icons/preferences-openscad.svg</file>
<file>icons/OpenSCAD_AddOpenSCADElement.svg</file>
<file>icons/OpenSCAD_ColorCodeShape.svg</file>
<file>icons/OpenSCAD_RefineShapeFeature.svg</file>
<file>icons/OpenSCAD_IncreaseToleranceFeature.svg</file>
<file>icons/OpenSCAD_ReplaceObject.svg</file>
<file>icons/OpenSCAD_RemoveSubtree.svg</file>
<file>icons/OpenSCAD_Explode_Group.svg</file>
<file>icons/OpenSCAD_MeshBooleans.svg</file>
<file>icons/OpenSCAD_Hull.svg</file>
<file>icons/OpenSCAD_Minkowski.svg</file>
<file>icons/OpenSCADWorkbench.svg</file>
<file>ui/openscadprefs-base.ui</file>
<file>translations/OpenSCAD_tr.qm</file>
<file>translations/OpenSCAD_sv-SE.qm</file>
<file>translations/OpenSCAD_de.qm</file>
<file>translations/OpenSCAD_pl.qm</file>
<file>translations/OpenSCAD_fi.qm</file>
<file>translations/OpenSCAD_zh-TW.qm</file>
<file>translations/OpenSCAD_no.qm</file>
<file>translations/OpenSCAD_nl.qm</file>
<file>translations/OpenSCAD_pt-BR.qm</file>
<file>translations/OpenSCAD_uk.qm</file>
<file>translations/OpenSCAD_cs.qm</file>
<file>translations/OpenSCAD_sk.qm</file>
<file>translations/OpenSCAD_fr.qm</file>
<file>translations/OpenSCAD_ru.qm</file>
<file>translations/OpenSCAD_af.qm</file>
<file>translations/OpenSCAD_hr.qm</file>
<file>translations/OpenSCAD_es-ES.qm</file>
<file>translations/OpenSCAD_zh-CN.qm</file>
<file>translations/OpenSCAD_ja.qm</file>
<file>translations/OpenSCAD_ro.qm</file>
<file>translations/OpenSCAD_hu.qm</file>
<file>translations/OpenSCAD_it.qm</file>
<file>translations/OpenSCAD_pt-PT.qm</file>
<file>translations/OpenSCAD_sr.qm</file>
<file>translations/OpenSCAD_el.qm</file>
<file>translations/OpenSCAD_sl.qm</file>
<file>translations/OpenSCAD_eu.qm</file>
<file>translations/OpenSCAD_ca.qm</file>
<file>translations/OpenSCAD_gl.qm</file>
<file>translations/OpenSCAD_kab.qm</file>
<file>translations/OpenSCAD_ko.qm</file>
<file>translations/OpenSCAD_fil.qm</file>
<file>translations/OpenSCAD_id.qm</file>
<file>translations/OpenSCAD_lt.qm</file>
<file>translations/OpenSCAD_val-ES.qm</file>
<file>translations/OpenSCAD_ar.qm</file>
<file>translations/OpenSCAD_vi.qm</file>
</qresource>
</RCC>
<RCC>
<qresource>
<file>icons/preferences-openscad.svg</file>
<file>icons/OpenSCAD_AddOpenSCADElement.svg</file>
<file>icons/OpenSCAD_ColorCodeShape.svg</file>
<file>icons/OpenSCAD_RefineShapeFeature.svg</file>
<file>icons/OpenSCAD_IncreaseToleranceFeature.svg</file>
<file>icons/OpenSCAD_ReplaceObject.svg</file>
<file>icons/OpenSCAD_RemoveSubtree.svg</file>
<file>icons/OpenSCAD_Explode_Group.svg</file>
<file>icons/OpenSCAD_MeshBooleans.svg</file>
<file>icons/OpenSCAD_Hull.svg</file>
<file>icons/OpenSCAD_Minkowski.svg</file>
<file>icons/OpenSCADWorkbench.svg</file>
<file>ui/openscadprefs-base.ui</file>
<file>translations/OpenSCAD_tr.qm</file>
<file>translations/OpenSCAD_sv-SE.qm</file>
<file>translations/OpenSCAD_de.qm</file>
<file>translations/OpenSCAD_pl.qm</file>
<file>translations/OpenSCAD_fi.qm</file>
<file>translations/OpenSCAD_zh-TW.qm</file>
<file>translations/OpenSCAD_no.qm</file>
<file>translations/OpenSCAD_nl.qm</file>
<file>translations/OpenSCAD_pt-BR.qm</file>
<file>translations/OpenSCAD_uk.qm</file>
<file>translations/OpenSCAD_cs.qm</file>
<file>translations/OpenSCAD_sk.qm</file>
<file>translations/OpenSCAD_fr.qm</file>
<file>translations/OpenSCAD_ru.qm</file>
<file>translations/OpenSCAD_af.qm</file>
<file>translations/OpenSCAD_hr.qm</file>
<file>translations/OpenSCAD_es-ES.qm</file>
<file>translations/OpenSCAD_zh-CN.qm</file>
<file>translations/OpenSCAD_ja.qm</file>
<file>translations/OpenSCAD_ro.qm</file>
<file>translations/OpenSCAD_hu.qm</file>
<file>translations/OpenSCAD_it.qm</file>
<file>translations/OpenSCAD_pt-PT.qm</file>
<file>translations/OpenSCAD_sr.qm</file>
<file>translations/OpenSCAD_el.qm</file>
<file>translations/OpenSCAD_sl.qm</file>
<file>translations/OpenSCAD_eu.qm</file>
<file>translations/OpenSCAD_ca.qm</file>
<file>translations/OpenSCAD_gl.qm</file>
<file>translations/OpenSCAD_kab.qm</file>
<file>translations/OpenSCAD_ko.qm</file>
<file>translations/OpenSCAD_fil.qm</file>
<file>translations/OpenSCAD_id.qm</file>
<file>translations/OpenSCAD_lt.qm</file>
<file>translations/OpenSCAD_val-ES.qm</file>
<file>translations/OpenSCAD_ar.qm</file>
<file>translations/OpenSCAD_vi.qm</file>
</qresource>
</RCC>

File diff suppressed because it is too large Load Diff

View File

@@ -87,6 +87,38 @@ class UnitBasicCases(unittest.TestCase):
v = FreeCAD.Units.parseQuantity(t[0]).getValueAs("ksi")
self.assertAlmostEqual(1, v.Value, msg="Failed with \"{0}\" scheme: {1} != 1 (delta: {2})".format(schemes[i], v.Value, self.delta), delta=self.delta)
def testSchemeTranslation(self):
quantities = []
for i in dir(FreeCAD.Units):
if issubclass(type(getattr(FreeCAD.Units, i)), FreeCAD.Units.Quantity):
quantities.append(i)
schemes = FreeCAD.Units.listSchemas()
for i in quantities:
q1 = getattr(FreeCAD.Units, i)
q1 = FreeCAD.Units.Quantity(q1)
q1.Format = {'Precision': 16}
for idx, val in enumerate(schemes):
t = FreeCAD.Units.schemaTranslate(q1, idx)
try:
q2 = FreeCAD.Units.Quantity(t[0])
if math.fabs(q1.Value - q2.Value) > 0.01:
print (q1, " : ", q2, " : ", t, " : ", i, " : ", val)
except Exception as e:
print ("{}: {}".format(str(e), t[0]))
def testVoltage(self):
q1 = FreeCAD.Units.Quantity("1e20 V")
t = FreeCAD.Units.schemaTranslate(q1, 0) # Standard
q2 = FreeCAD.Units.Quantity(t[0])
self.assertAlmostEqual(q1.Value, q2.Value, delta=self.delta)
def testEnergy(self):
q1 = FreeCAD.Units.Quantity("1e20 J")
t = FreeCAD.Units.schemaTranslate(q1, 0) # Standard
q2 = FreeCAD.Units.Quantity(t[0])
self.assertAlmostEqual(q1.Value, q2.Value, delta=self.delta)
def testTrigonometric(self):
#tu=FreeCAD.Units.translateUnit
self.failUnless(compare(tu('sin(pi)'), math.sin(math.pi)))

View File

@@ -1,30 +1,30 @@
/** \addtogroup WORKBENCHES
Most of FreeCAD's functionality is defined in dedicated Workbenches
Those plugins, also called \b modules or \b workbenches, provide
functionality for specialized facets of FreeCAD. The word \b module
refers to any new group of tools, while \b workbench designates
specifically a GUI group of tools in the FreeCAD interface. All
workbenches are defined in modules, but not all modules contain a
workbench. Practically, though, all the main modules define a
workbench with the same name, so the terms are almost interchangeable.
Some of these modules are programmed in C++, others in Python, and some
in a mix of C++ and Python.
*/
/** \defgroup CWORKBENCHES C++ workbenches
* \ingroup WORKBENCHES
* \brief These workbenches are programmed primarily in C++, but most provide a Python API as well.
*/
/** \defgroup PYTHONWORKBENCHES Python workbenches
* \ingroup WORKBENCHES
* \brief Those are workbenches programmed primarily in Python
*/
/** \defgroup UTILITIES Utility modules
* \ingroup WORKBENCHES
* \brief Modules that provide utility tools to FreeCAD but don't define a workbench
*/
/** \addtogroup WORKBENCHES
Most of FreeCAD's functionality is defined in dedicated Workbenches
Those plugins, also called \b modules or \b workbenches, provide
functionality for specialized facets of FreeCAD. The word \b module
refers to any new group of tools, while \b workbench designates
specifically a GUI group of tools in the FreeCAD interface. All
workbenches are defined in modules, but not all modules contain a
workbench. Practically, though, all the main modules define a
workbench with the same name, so the terms are almost interchangeable.
Some of these modules are programmed in C++, others in Python, and some
in a mix of C++ and Python.
*/
/** \defgroup CWORKBENCHES C++ workbenches
* \ingroup WORKBENCHES
* \brief These workbenches are programmed primarily in C++, but most provide a Python API as well.
*/
/** \defgroup PYTHONWORKBENCHES Python workbenches
* \ingroup WORKBENCHES
* \brief Those are workbenches programmed primarily in Python
*/
/** \defgroup UTILITIES Utility modules
* \ingroup WORKBENCHES
* \brief Modules that provide utility tools to FreeCAD but don't define a workbench
*/