Merge branch 'master' into addImportExportRecentFilesPrefs
@@ -345,12 +345,12 @@ const char circleLine11_marker[CIRCLE_LINE11_WIDTH * CIRCLE_LINE11_HEIGHT + 1] =
|
||||
" "
|
||||
" xxxxxx "
|
||||
" xxxxxxxx "
|
||||
" xx xx "
|
||||
" xxx xxx"
|
||||
" xx xx"
|
||||
" xx xx"
|
||||
" xx xx"
|
||||
" xx xx"
|
||||
" xx xx "
|
||||
" xxx xxx"
|
||||
" xxxxxxxx "
|
||||
" xxxxxx "};
|
||||
|
||||
@@ -381,7 +381,7 @@ const char circleLine15_marker[CIRCLE_LINE15_WIDTH * CIRCLE_LINE15_HEIGHT + 1] =
|
||||
" "
|
||||
" xxxxxx "
|
||||
" xxxxxxxxxx "
|
||||
" xx xx "
|
||||
" xxx xxx "
|
||||
" xx xx "
|
||||
" xx xx"
|
||||
" xx xx"
|
||||
@@ -390,7 +390,7 @@ const char circleLine15_marker[CIRCLE_LINE15_WIDTH * CIRCLE_LINE15_HEIGHT + 1] =
|
||||
" xx xx"
|
||||
" xx xx"
|
||||
" xx xx "
|
||||
" xx xxxx"
|
||||
" xxx xxx "
|
||||
" xxxxxxxxxx "
|
||||
" xxxxxx "};
|
||||
|
||||
@@ -401,12 +401,12 @@ const char circleFilled11_marker[CIRCLE_FILLED11_WIDTH * CIRCLE_FILLED11_HEIGHT
|
||||
" "
|
||||
" xxxxxx "
|
||||
" xxxxxxxx "
|
||||
" xxxxxxxx "
|
||||
" xxxxxxxxxx"
|
||||
" xxxxxxxxxx"
|
||||
" xxxxxxxxxx"
|
||||
" xxxxxxxxxx"
|
||||
" xxxxxxxx "
|
||||
" xxxxxxxxxx"
|
||||
" xxxxxxxxxx"
|
||||
" xxxxxxxx "
|
||||
" xxxxxx "};
|
||||
|
||||
@@ -446,7 +446,7 @@ const char circleFilled15_marker[CIRCLE_FILLED15_WIDTH * CIRCLE_FILLED15_HEIGHT
|
||||
" xxxxxxxxxxxxxx"
|
||||
" xxxxxxxxxxxxxx"
|
||||
" xxxxxxxxxxxx "
|
||||
" xxxxxxxxxxxx"
|
||||
" xxxxxxxxxxxx "
|
||||
" xxxxxxxxxx "
|
||||
" xxxxxx "};
|
||||
|
||||
|
||||
@@ -774,47 +774,53 @@ bool View3DInventor::setCamera(const char* pCamera)
|
||||
SoNode * Cam;
|
||||
SoDB::read(&in,Cam);
|
||||
|
||||
if (!Cam){
|
||||
if (!Cam || !Cam->isOfType(SoCamera::getClassTypeId())) {
|
||||
throw Base::RuntimeError("Camera settings failed to read");
|
||||
}
|
||||
|
||||
// this is to make sure to reliably delete the node
|
||||
CoinPtr<SoNode> camPtr(Cam, true);
|
||||
|
||||
// toggle between perspective and orthographic camera
|
||||
if (Cam->getTypeId() != CamViewer->getTypeId())
|
||||
{
|
||||
if (Cam->getTypeId() != CamViewer->getTypeId()) {
|
||||
_viewer->setCameraType(Cam->getTypeId());
|
||||
CamViewer = _viewer->getSoRenderManager()->getCamera();
|
||||
}
|
||||
|
||||
SoPerspectiveCamera * CamViewerP = 0;
|
||||
SoOrthographicCamera * CamViewerO = 0;
|
||||
SoPerspectiveCamera * CamViewerP = nullptr;
|
||||
SoOrthographicCamera * CamViewerO = nullptr;
|
||||
|
||||
if (CamViewer->getTypeId() == SoPerspectiveCamera::getClassTypeId()) {
|
||||
CamViewerP = (SoPerspectiveCamera *)CamViewer; // safe downward cast, knows the type
|
||||
} else if (CamViewer->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
|
||||
CamViewerO = (SoOrthographicCamera *)CamViewer; // safe downward cast, knows the type
|
||||
CamViewerP = static_cast<SoPerspectiveCamera *>(CamViewer); // safe downward cast, knows the type
|
||||
}
|
||||
else if (CamViewer->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
|
||||
CamViewerO = static_cast<SoOrthographicCamera *>(CamViewer); // safe downward cast, knows the type
|
||||
}
|
||||
|
||||
if (Cam->getTypeId() == SoPerspectiveCamera::getClassTypeId()) {
|
||||
if (CamViewerP){
|
||||
CamViewerP->position = ((SoPerspectiveCamera *)Cam)->position;
|
||||
CamViewerP->orientation = ((SoPerspectiveCamera *)Cam)->orientation;
|
||||
CamViewerP->nearDistance = ((SoPerspectiveCamera *)Cam)->nearDistance;
|
||||
CamViewerP->farDistance = ((SoPerspectiveCamera *)Cam)->farDistance;
|
||||
CamViewerP->focalDistance = ((SoPerspectiveCamera *)Cam)->focalDistance;
|
||||
} else {
|
||||
CamViewerP->position = static_cast<SoPerspectiveCamera *>(Cam)->position;
|
||||
CamViewerP->orientation = static_cast<SoPerspectiveCamera *>(Cam)->orientation;
|
||||
CamViewerP->nearDistance = static_cast<SoPerspectiveCamera *>(Cam)->nearDistance;
|
||||
CamViewerP->farDistance = static_cast<SoPerspectiveCamera *>(Cam)->farDistance;
|
||||
CamViewerP->focalDistance = static_cast<SoPerspectiveCamera *>(Cam)->focalDistance;
|
||||
}
|
||||
else {
|
||||
throw Base::TypeError("Camera type mismatch");
|
||||
}
|
||||
} else if (Cam->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
|
||||
}
|
||||
else if (Cam->getTypeId() == SoOrthographicCamera::getClassTypeId()) {
|
||||
if (CamViewerO){
|
||||
CamViewerO->viewportMapping = ((SoOrthographicCamera *)Cam)->viewportMapping;
|
||||
CamViewerO->position = ((SoOrthographicCamera *)Cam)->position;
|
||||
CamViewerO->orientation = ((SoOrthographicCamera *)Cam)->orientation;
|
||||
CamViewerO->nearDistance = ((SoOrthographicCamera *)Cam)->nearDistance;
|
||||
CamViewerO->farDistance = ((SoOrthographicCamera *)Cam)->farDistance;
|
||||
CamViewerO->focalDistance = ((SoOrthographicCamera *)Cam)->focalDistance;
|
||||
CamViewerO->aspectRatio = ((SoOrthographicCamera *)Cam)->aspectRatio ;
|
||||
CamViewerO->height = ((SoOrthographicCamera *)Cam)->height;
|
||||
} else {
|
||||
CamViewerO->viewportMapping = static_cast<SoOrthographicCamera *>(Cam)->viewportMapping;
|
||||
CamViewerO->position = static_cast<SoOrthographicCamera *>(Cam)->position;
|
||||
CamViewerO->orientation = static_cast<SoOrthographicCamera *>(Cam)->orientation;
|
||||
CamViewerO->nearDistance = static_cast<SoOrthographicCamera *>(Cam)->nearDistance;
|
||||
CamViewerO->farDistance = static_cast<SoOrthographicCamera *>(Cam)->farDistance;
|
||||
CamViewerO->focalDistance = static_cast<SoOrthographicCamera *>(Cam)->focalDistance;
|
||||
CamViewerO->aspectRatio = static_cast<SoOrthographicCamera *>(Cam)->aspectRatio ;
|
||||
CamViewerO->height = static_cast<SoOrthographicCamera *>(Cam)->height;
|
||||
}
|
||||
else {
|
||||
throw Base::TypeError("Camera type mismatch");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,13 +68,11 @@ void ViewProviderLine::attach ( App::DocumentObject *obj ) {
|
||||
sep->addChild ( pCoords );
|
||||
|
||||
SoIndexedLineSet *pLines = new SoIndexedLineSet ();
|
||||
pLines->ref();
|
||||
pLines->coordIndex.setNum(3);
|
||||
pLines->coordIndex.setValues(0, 3, lines);
|
||||
sep->addChild ( pLines );
|
||||
|
||||
SoTranslation *textTranslation = new SoTranslation ();
|
||||
textTranslation->ref ();
|
||||
textTranslation->translation.setValue ( SbVec3f ( -size * 49. / 50., size / 30., 0 ) );
|
||||
sep->addChild ( textTranslation );
|
||||
|
||||
|
||||
@@ -70,13 +70,11 @@ void ViewProviderPlane::attach ( App::DocumentObject *obj ) {
|
||||
sep->addChild ( pCoords );
|
||||
|
||||
SoIndexedLineSet *pLines = new SoIndexedLineSet ();
|
||||
pLines->ref();
|
||||
pLines->coordIndex.setNum(6);
|
||||
pLines->coordIndex.setValues(0, 6, lines);
|
||||
sep->addChild ( pLines );
|
||||
|
||||
SoTranslation *textTranslation = new SoTranslation ();
|
||||
textTranslation->ref ();
|
||||
textTranslation->translation.setValue ( SbVec3f ( -size * 49. / 50., size * 9./10., 0 ) );
|
||||
sep->addChild ( textTranslation );
|
||||
|
||||
|
||||
@@ -410,14 +410,8 @@ class Snapper:
|
||||
if (not self.maxEdges) or (len(shape.Edges) <= self.maxEdges):
|
||||
if "Edge" in comp:
|
||||
# we are snapping to an edge
|
||||
edge = None
|
||||
if shape.ShapeType == "Edge":
|
||||
edge = shape
|
||||
else:
|
||||
en = int(comp[4:])-1
|
||||
if len(shape.Edges) > en:
|
||||
edge = shape.Edges[en]
|
||||
if edge:
|
||||
snaps.extend(self.snapToEndpoints(edge))
|
||||
snaps.extend(self.snapToMidpoint(edge))
|
||||
snaps.extend(self.snapToPerpendicular(edge, lastpoint))
|
||||
@@ -433,9 +427,9 @@ class Snapper:
|
||||
# extra ellipse options
|
||||
snaps.extend(self.snapToCenter(edge))
|
||||
elif "Face" in comp:
|
||||
en = int(comp[4:])-1
|
||||
if len(shape.Faces) > en:
|
||||
face = shape.Faces[en]
|
||||
# we are snapping to a face
|
||||
if shape.ShapeType == "Face":
|
||||
face = shape
|
||||
snaps.extend(self.snapToFace(face))
|
||||
elif "Vertex" in comp:
|
||||
# directly snapped to a vertex
|
||||
|
||||
@@ -226,7 +226,7 @@ void PropertyGeometryList::Restore(Base::XMLReader &reader)
|
||||
reader.readEndElement("GeometryList");
|
||||
|
||||
// assignment
|
||||
setValues(values);
|
||||
setValues(std::move(values));
|
||||
}
|
||||
|
||||
App::Property *PropertyGeometryList::Copy(void) const
|
||||
|
||||
@@ -1133,7 +1133,10 @@ void ViewProviderPartExt::updateVisual()
|
||||
const TopoDS_Face &actFace = TopoDS::Face(faceMap(i));
|
||||
// get the mesh of the shape
|
||||
Handle (Poly_Triangulation) mesh = BRep_Tool::Triangulation(actFace,aLoc);
|
||||
if (mesh.IsNull()) continue;
|
||||
if (mesh.IsNull()) {
|
||||
parts[ii] = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
// getting the transformation of the shape/face
|
||||
gp_Trsf myTransf;
|
||||
|
||||
@@ -419,7 +419,7 @@ class PathDressupTagViewProvider:
|
||||
'''this makes sure that the base operation is added back to the job and visible'''
|
||||
# pylint: disable=unused-argument
|
||||
PathLog.track()
|
||||
if self.obj.Base.ViewObject:
|
||||
if self.obj.Base and self.obj.Base.ViewObject:
|
||||
self.obj.Base.ViewObject.Visibility = True
|
||||
job = PathUtils.findParentJob(self.obj)
|
||||
if arg1.Object and arg1.Object.Base and job:
|
||||
|
||||
@@ -522,6 +522,7 @@ class StockCreateCylinderEdit(StockEdit):
|
||||
class StockFromExistingEdit(StockEdit):
|
||||
Index = 3
|
||||
StockType = PathStock.StockType.Unknown
|
||||
StockLabelPrefix = 'Stock'
|
||||
|
||||
def editorFrame(self):
|
||||
return self.form.stockFromExisting
|
||||
@@ -530,7 +531,7 @@ class StockFromExistingEdit(StockEdit):
|
||||
stock = self.form.stockExisting.itemData(self.form.stockExisting.currentIndex())
|
||||
if not (hasattr(obj.Stock, 'Objects') and len(obj.Stock.Objects) == 1 and obj.Stock.Objects[0] == stock):
|
||||
if stock:
|
||||
stock = PathJob.createResourceClone(obj, stock, 'Stock', 'Stock')
|
||||
stock = PathJob.createResourceClone(obj, stock, self.StockLabelPrefix , 'Stock')
|
||||
stock.ViewObject.Visibility = True
|
||||
PathStock.SetupStockObject(stock, PathStock.StockType.Unknown)
|
||||
stock.Proxy.execute(stock)
|
||||
@@ -556,7 +557,9 @@ class StockFromExistingEdit(StockEdit):
|
||||
index = -1
|
||||
for i, solid in enumerate(self.candidates(obj)):
|
||||
self.form.stockExisting.addItem(solid.Label, solid)
|
||||
if solid.Label == stockName:
|
||||
label="{}-{}".format(self.StockLabelPrefix, solid.Label)
|
||||
|
||||
if label == stockName:
|
||||
index = i
|
||||
self.form.stockExisting.setCurrentIndex(index if index != -1 else 0)
|
||||
|
||||
|
||||
@@ -67,8 +67,7 @@ class CommandPathSimpleCopy:
|
||||
|
||||
FreeCADGui.addModule("PathScripts.PathUtils")
|
||||
FreeCADGui.addModule("PathScripts.PathCustom")
|
||||
FreeCADGui.doCommand('obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","' + selection[0].Name + '_SimpleCopy")')
|
||||
FreeCADGui.doCommand('PathScripts.PathCustom.ObjectCustom(obj)')
|
||||
FreeCADGui.doCommand('obj = PathScripts.PathCustom.Create("' + selection[0].Name + '_SimpleCopy")')
|
||||
FreeCADGui.doCommand('obj.ViewObject.Proxy = 0')
|
||||
FreeCADGui.doCommand('obj.Gcode = [c.toGCode() for c in srcpath.Commands]')
|
||||
FreeCADGui.doCommand('PathScripts.PathUtils.addToJob(obj)')
|
||||
|
||||
513
src/Mod/Path/PathScripts/post/fanuc_post.py
Normal file
@@ -0,0 +1,513 @@
|
||||
# ***************************************************************************
|
||||
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
|
||||
# * Copyright (c) 2021 shadowbane1000 <tyler@colberts.us> *
|
||||
# * *
|
||||
# * 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 *
|
||||
# * *
|
||||
# ***************************************************************************/
|
||||
from __future__ import print_function
|
||||
import FreeCAD
|
||||
from FreeCAD import Units
|
||||
import Path
|
||||
import argparse
|
||||
import datetime
|
||||
import shlex
|
||||
import os.path
|
||||
from PathScripts import PostUtils
|
||||
from PathScripts import PathUtils
|
||||
|
||||
TOOLTIP = '''
|
||||
This is a postprocessor file for the Path workbench. It is used to
|
||||
take a pseudo-gcode fragment outputted by a Path object, and output
|
||||
real GCode suitable should be suitable for most Fanuc controllers.
|
||||
It has only been tested on a 21i-MB controller on a 3 axis mill.
|
||||
This postprocessor, once placed in the appropriate PathScripts folder,
|
||||
can be used directly from inside FreeCAD, via the GUI importer or via
|
||||
python scripts with:
|
||||
|
||||
import fanuc_post
|
||||
fanuc_post.export(object,"/path/to/file.ncc","")
|
||||
'''
|
||||
|
||||
now = datetime.datetime.now()
|
||||
|
||||
parser = argparse.ArgumentParser(prog='fanuc', add_help=False)
|
||||
parser.add_argument('--no-header', action='store_true', help='suppress header output')
|
||||
parser.add_argument('--no-comments', action='store_true', help='suppress comment output')
|
||||
parser.add_argument('--line-numbers', action='store_true', help='prefix with line numbers')
|
||||
parser.add_argument('--no-show-editor', action='store_true', help='don\'t pop up editor before writing output')
|
||||
parser.add_argument('--precision', default='3', help='number of digits of precision, default=3')
|
||||
parser.add_argument('--preamble', help='set commands to be issued before the first command, default="G17\nG90"')
|
||||
parser.add_argument('--postamble', help='set commands to be issued after the last command, default="M05\nG17 G90\nM2"')
|
||||
parser.add_argument('--inches', action='store_true', help='Convert output for US imperial mode (G20)')
|
||||
parser.add_argument('--no-modal', action='store_true', help='Don\'t output the Same G-command Name USE NonModal Mode')
|
||||
parser.add_argument('--no-axis-modal', action='store_true', help='Don\'t output the Same Axis Value Mode')
|
||||
parser.add_argument('--no-tlo', action='store_true', help='suppress tool length offset (G43) following tool changes')
|
||||
|
||||
TOOLTIP_ARGS = parser.format_help()
|
||||
|
||||
# These globals set common customization preferences
|
||||
OUTPUT_COMMENTS = True
|
||||
OUTPUT_HEADER = True
|
||||
OUTPUT_LINE_NUMBERS = False
|
||||
SHOW_EDITOR = True
|
||||
MODAL = True # if true commands are suppressed if the same as previous line.
|
||||
USE_TLO = True # if true G43 will be output following tool changes
|
||||
OUTPUT_DOUBLES = False # if false duplicate axis values are suppressed if the same as previous line.
|
||||
COMMAND_SPACE = " "
|
||||
LINENR = 100 # line number starting value
|
||||
|
||||
# These globals will be reflected in the Machine configuration of the project
|
||||
UNITS = "G21" # G21 for metric, G20 for us standard
|
||||
UNIT_SPEED_FORMAT = 'mm/min'
|
||||
UNIT_FORMAT = 'mm'
|
||||
|
||||
MACHINE_NAME = "fanuc"
|
||||
CORNER_MIN = {'x': 0, 'y': 0, 'z': 0}
|
||||
CORNER_MAX = {'x': 500, 'y': 300, 'z': 300}
|
||||
PRECISION = 3
|
||||
|
||||
# this global is used to pass spindle speed from the tool command into the machining command for
|
||||
# rigid tapping.
|
||||
tapSpeed = 0
|
||||
|
||||
# Preamble text will appear at the beginning of the GCODE output file.
|
||||
PREAMBLE = '''G17 G54 G40 G49 G80 G90
|
||||
'''
|
||||
|
||||
# Postamble text will appear following the last operation.
|
||||
POSTAMBLE = '''M05
|
||||
G17 G54 G90 G80 G40
|
||||
M6 T0
|
||||
M2
|
||||
'''
|
||||
|
||||
# Pre operation text will be inserted before every operation
|
||||
PRE_OPERATION = ''''''
|
||||
|
||||
# Post operation text will be inserted after every operation
|
||||
POST_OPERATION = ''''''
|
||||
|
||||
# Tool Change commands will be inserted before a tool change
|
||||
TOOL_CHANGE = ''''''
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ in ['__builtin__','io']:
|
||||
pythonopen = open
|
||||
|
||||
|
||||
def processArguments(argstring):
|
||||
# pylint: disable=global-statement
|
||||
global OUTPUT_HEADER
|
||||
global OUTPUT_COMMENTS
|
||||
global OUTPUT_LINE_NUMBERS
|
||||
global SHOW_EDITOR
|
||||
global PRECISION
|
||||
global PREAMBLE
|
||||
global POSTAMBLE
|
||||
global UNITS
|
||||
global UNIT_SPEED_FORMAT
|
||||
global UNIT_FORMAT
|
||||
global MODAL
|
||||
global USE_TLO
|
||||
global OUTPUT_DOUBLES
|
||||
|
||||
try:
|
||||
args = parser.parse_args(shlex.split(argstring))
|
||||
if args.no_header:
|
||||
OUTPUT_HEADER = False
|
||||
if args.no_comments:
|
||||
OUTPUT_COMMENTS = False
|
||||
if args.line_numbers:
|
||||
OUTPUT_LINE_NUMBERS = True
|
||||
if args.no_show_editor:
|
||||
SHOW_EDITOR = False
|
||||
print("Show editor = %d" % SHOW_EDITOR)
|
||||
PRECISION = args.precision
|
||||
if args.preamble is not None:
|
||||
PREAMBLE = args.preamble
|
||||
if args.postamble is not None:
|
||||
POSTAMBLE = args.postamble
|
||||
if args.inches:
|
||||
UNITS = 'G20'
|
||||
UNIT_SPEED_FORMAT = 'in/min'
|
||||
UNIT_FORMAT = 'in'
|
||||
PRECISION = 4
|
||||
if args.no_modal:
|
||||
MODAL = False
|
||||
if args.no_tlo:
|
||||
USE_TLO = False
|
||||
if args.no_axis_modal:
|
||||
OUTPUT_DOUBLES = true
|
||||
|
||||
except Exception: # pylint: disable=broad-except
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def export(objectslist, filename, argstring):
|
||||
# pylint: disable=global-statement
|
||||
if not processArguments(argstring):
|
||||
return None
|
||||
global UNITS
|
||||
global UNIT_FORMAT
|
||||
global UNIT_SPEED_FORMAT
|
||||
global HORIZRAPID
|
||||
global VERTRAPID
|
||||
|
||||
for obj in objectslist:
|
||||
if not hasattr(obj, "Path"):
|
||||
print("the object " + obj.Name + " is not a path. Please select only path and Compounds.")
|
||||
return None
|
||||
|
||||
print("postprocessing...")
|
||||
gcode = ""
|
||||
|
||||
# write header
|
||||
if OUTPUT_HEADER:
|
||||
gcode += "%\n"
|
||||
gcode += ";\n"
|
||||
gcode += os.path.split(filename)[-1]+" ("+"FREECAD-FILENAME-GOES-HERE" + ", " + "JOB-NAME-GOES-HERE"+")\n"
|
||||
gcode += linenumber() + "("+filename.upper()+",EXPORTED BY FREECAD!)\n"
|
||||
gcode += linenumber() + "(POST PROCESSOR: " + __name__.upper() + ")\n"
|
||||
gcode += linenumber() + "(OUTPUT TIME:" + str(now).upper() + ")\n"
|
||||
|
||||
# Write the preamble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(BEGIN PREAMBLE)\n"
|
||||
for line in PREAMBLE.splitlines(False):
|
||||
gcode += linenumber() + line + "\n"
|
||||
gcode += linenumber() + UNITS + "\n"
|
||||
|
||||
for obj in objectslist:
|
||||
|
||||
# Skip inactive operations
|
||||
if hasattr(obj, 'Active'):
|
||||
if not obj.Active:
|
||||
continue
|
||||
if hasattr(obj, 'Base') and hasattr(obj.Base, 'Active'):
|
||||
if not obj.Base.Active:
|
||||
continue
|
||||
|
||||
# fetch machine details
|
||||
job = PathUtils.findParentJob(obj)
|
||||
|
||||
myMachine = 'not set'
|
||||
|
||||
if hasattr(job, "MachineName"):
|
||||
myMachine = job.MachineName
|
||||
|
||||
if hasattr(job, "MachineUnits"):
|
||||
if job.MachineUnits == "Metric":
|
||||
UNITS = "G21"
|
||||
UNIT_FORMAT = 'mm'
|
||||
UNIT_SPEED_FORMAT = 'mm/min'
|
||||
else:
|
||||
UNITS = "G20"
|
||||
UNIT_FORMAT = 'in'
|
||||
UNIT_SPEED_FORMAT = 'in/min'
|
||||
|
||||
if hasattr(job, "SetupSheet"):
|
||||
if hasattr(job.SetupSheet, "HorizRapid"):
|
||||
HORIZRAPID = Units.Quantity(job.SetupSheet.HorizRapid, FreeCAD.Units.Velocity)
|
||||
if hasattr(job.SetupSheet, "VertRapid"):
|
||||
VERTRAPID = Units.Quantity(job.SetupSheet.HorizRapid, FreeCAD.Units.Velocity)
|
||||
|
||||
# do the pre_op
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(BEGIN OPERATION: %s)\n" % obj.Label.upper()
|
||||
gcode += linenumber() + "(MACHINE: %s, %s)\n" % (myMachine.upper(), UNIT_SPEED_FORMAT.upper())
|
||||
for line in PRE_OPERATION.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
|
||||
# get coolant mode
|
||||
coolantMode = 'None'
|
||||
if hasattr(obj, "CoolantMode") or hasattr(obj, 'Base') and hasattr(obj.Base, "CoolantMode"):
|
||||
if hasattr(obj, "CoolantMode"):
|
||||
coolantMode = obj.CoolantMode
|
||||
else:
|
||||
coolantMode = obj.Base.CoolantMode
|
||||
|
||||
# turn coolant on if required
|
||||
if OUTPUT_COMMENTS:
|
||||
if not coolantMode == 'None':
|
||||
gcode += linenumber() + '(COOLANT ON:' + coolantMode.upper() + ')\n'
|
||||
if coolantMode == 'Flood':
|
||||
gcode += linenumber() + 'M8' + '\n'
|
||||
if coolantMode == 'Mist':
|
||||
gcode += linenumber() + 'M7' + '\n'
|
||||
|
||||
# process the operation gcode
|
||||
gcode += parse(obj)
|
||||
|
||||
# do the post_op
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + "(FINISH OPERATION: %s)\n" % obj.Label.upper()
|
||||
for line in POST_OPERATION.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
|
||||
# turn coolant off if required
|
||||
if not coolantMode == 'None':
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += linenumber() + '(COOLANT OFF:' + coolantMode.upper() + ')\n'
|
||||
gcode += linenumber() +'M9' + '\n'
|
||||
|
||||
# do the post_amble
|
||||
if OUTPUT_COMMENTS:
|
||||
gcode += "(BEGIN POSTAMBLE)\n"
|
||||
for line in POSTAMBLE.splitlines(True):
|
||||
gcode += linenumber() + line
|
||||
gcode += "%\n"
|
||||
|
||||
if FreeCAD.GuiUp and SHOW_EDITOR:
|
||||
dia = PostUtils.GCodeEditorDialog()
|
||||
dia.editor.setText(gcode)
|
||||
result = dia.exec_()
|
||||
if result:
|
||||
final = dia.editor.toPlainText()
|
||||
else:
|
||||
final = gcode
|
||||
else:
|
||||
final = gcode
|
||||
|
||||
print("done postprocessing.")
|
||||
|
||||
if not filename == '-':
|
||||
gfile = pythonopen(filename, "w")
|
||||
gfile.write(final)
|
||||
gfile.close()
|
||||
|
||||
return final
|
||||
|
||||
|
||||
def linenumber():
|
||||
# pylint: disable=global-statement
|
||||
global LINENR
|
||||
if OUTPUT_LINE_NUMBERS is True:
|
||||
LINENR += 10
|
||||
return "N" + str(LINENR) + " "
|
||||
return ""
|
||||
|
||||
|
||||
def parse(pathobj):
|
||||
# pylint: disable=global-statement
|
||||
global PRECISION
|
||||
global MODAL
|
||||
global OUTPUT_DOUBLES
|
||||
global UNIT_FORMAT
|
||||
global UNIT_SPEED_FORMAT
|
||||
global tapSpeed
|
||||
|
||||
out = ""
|
||||
lastcommand = None
|
||||
precision_string = '.' + str(PRECISION) + 'f'
|
||||
currLocation = {} # keep track for no doubles
|
||||
print("Startup!")
|
||||
|
||||
# the order of parameters
|
||||
# arcs need work. original code from mach3_4 doesn't want K properties on XY plane. Not sure
|
||||
# what fanuc does here.
|
||||
params = ['X', 'Y', 'Z', 'A', 'B', 'C', 'I', 'J', 'F', 'S', 'T', 'Q', 'R', 'L', 'H', 'D', 'P']
|
||||
firstmove = Path.Command("G0", {"X": -1, "Y": -1, "Z": -1, "F": 0.0})
|
||||
currLocation.update(firstmove.Parameters) # set First location Parameters
|
||||
|
||||
if hasattr(pathobj, "Group"): # We have a compound or project.
|
||||
# if OUTPUT_COMMENTS:
|
||||
# out += linenumber() + "(compound: " + pathobj.Label + ")\n"
|
||||
for p in pathobj.Group:
|
||||
out += parse(p)
|
||||
return out
|
||||
else: # parsing simple path
|
||||
|
||||
# groups might contain non-path things like stock.
|
||||
if not hasattr(pathobj, "Path"):
|
||||
return out
|
||||
|
||||
# if OUTPUT_COMMENTS:
|
||||
# out += linenumber() + "(" + pathobj.Label + ")\n"
|
||||
|
||||
adaptiveOp = False
|
||||
opHorizRapid = 0
|
||||
opVertRapid = 0
|
||||
|
||||
if 'Adaptive' in pathobj.Name:
|
||||
adaptiveOp = True
|
||||
if hasattr(pathobj, 'ToolController'):
|
||||
if hasattr(pathobj.ToolController, 'HorizRapid') and pathobj.ToolController.HorizRapid > 0:
|
||||
opHorizRapid = Units.Quantity(pathobj.ToolController.HorizRapid, FreeCAD.Units.Velocity)
|
||||
else:
|
||||
FreeCAD.Console.PrintWarning('Tool Controller Horizontal Rapid Values are unset'+ '\n')
|
||||
|
||||
if hasattr(pathobj.ToolController, 'VertRapid') and pathobj.ToolController.VertRapid > 0:
|
||||
opVertRapid = Units.Quantity(pathobj.ToolController.VertRapid, FreeCAD.Units.Velocity)
|
||||
else:
|
||||
FreeCAD.Console.PrintWarning('Tool Controller Vertical Rapid Values are unset'+ '\n')
|
||||
|
||||
for index,c in enumerate(pathobj.Path.Commands):
|
||||
|
||||
outstring = []
|
||||
command = c.Name
|
||||
if index+1 == len(pathobj.Path.Commands):
|
||||
nextcommand = ""
|
||||
else:
|
||||
nextcommand = pathobj.Path.Commands[index+1].Name
|
||||
|
||||
if adaptiveOp and c.Name in ["G0", "G00"]:
|
||||
if opHorizRapid and opVertRapid:
|
||||
command = 'G1'
|
||||
else:
|
||||
outstring.append('(TOOL CONTROLLER RAPID VALUES ARE UNSET)' + '\n')
|
||||
|
||||
# suppress moves in fixture selection
|
||||
if pathobj.Label == "Fixture":
|
||||
if command == "G0":
|
||||
continue
|
||||
|
||||
# if it's a tap, we rigid tap, so don't start the spindle yet...
|
||||
if command == "M03" or command == "M3":
|
||||
if pathobj.Tool.ToolType == "Tap":
|
||||
tapSpeed = int(pathobj.SpindleSpeed)
|
||||
continue
|
||||
|
||||
# convert drill cycles to tap cycles if tool is a tap
|
||||
if command == "G81" or command == "G83":
|
||||
if hasattr(pathobj, 'ToolController') and pathobj.ToolController.Tool.ToolType == "Tap":
|
||||
command = "G84"
|
||||
out += linenumber() + "G95\n"
|
||||
paramstring = ""
|
||||
for param in [ "X", "Y" ]:
|
||||
if param in c.Parameters:
|
||||
if (not OUTPUT_DOUBLES) and (param in currLocation) and (currLocation[param] == c.Parameters[param]):
|
||||
continue
|
||||
else:
|
||||
pos = Units.Quantity(c.Parameters[param], FreeCAD.Units.Length)
|
||||
paramstring += " " + param + format(float(pos.getValueAs(UNIT_FORMAT)), precision_string)
|
||||
if paramstring != "":
|
||||
out += linenumber() + "G00"+paramstring+"\n"
|
||||
|
||||
if "S" in c.Parameters:
|
||||
tapSpeed = int(c.Parameters['S'])
|
||||
out += "M29 S"+str(tapSpeed)+"\n"
|
||||
|
||||
for param in [ "Z", "R" ]:
|
||||
if param in c.Parameters:
|
||||
if (not OUTPUT_DOUBLES) and (param in currLocation) and (currLocation[param] == c.Parameters[param]):
|
||||
continue
|
||||
else:
|
||||
pos = Units.Quantity(c.Parameters[param], FreeCAD.Units.Length)
|
||||
paramstring += " " + param + format(float(pos.getValueAs(UNIT_FORMAT)), precision_string)
|
||||
# in this mode, F is the distance per revolution of the thread (pitch)
|
||||
# P is the dwell time in seconds at the bottom of the thread
|
||||
# Q is the peck depth of the threading operation
|
||||
for param in [ "F", "P", "Q" ]:
|
||||
if param in c.Parameters:
|
||||
value = Units.Quantity(c.Parameters[param], FreeCAD.Units.Length)
|
||||
paramstring += " " + param + format(float(value.getValueAs(UNIT_FORMAT)), precision_string)
|
||||
|
||||
out += linenumber() + "G84" + paramstring + "\n"
|
||||
out += linenumber() + "G80\n"
|
||||
out += linenumber() + "G94\n"
|
||||
continue
|
||||
|
||||
|
||||
outstring.append(command)
|
||||
|
||||
# if modal: suppress the command if it is the same as the last one
|
||||
if MODAL is True:
|
||||
if command == lastcommand:
|
||||
outstring.pop(0)
|
||||
|
||||
# suppress a G80 between two identical command
|
||||
if command == "G80" and lastcommand == nextcommand:
|
||||
continue
|
||||
|
||||
if c.Name[0] == '(' and not OUTPUT_COMMENTS: # command is a comment
|
||||
continue
|
||||
|
||||
# Now add the remaining parameters in order
|
||||
for param in params:
|
||||
if param in c.Parameters:
|
||||
if param == 'F' and (currLocation[param] != c.Parameters[param] or OUTPUT_DOUBLES):
|
||||
if c.Name not in ["G0", "G00"]: # fanuc doesn't use rapid speeds
|
||||
speed = Units.Quantity(c.Parameters['F'], FreeCAD.Units.Velocity)
|
||||
if speed.getValueAs(UNIT_SPEED_FORMAT) > 0.0:
|
||||
outstring.append(param + format(float(speed.getValueAs(UNIT_SPEED_FORMAT)), precision_string))
|
||||
else:
|
||||
continue
|
||||
elif param == 'T':
|
||||
outstring.append(param + str(int(c.Parameters['T'])))
|
||||
elif param == 'H':
|
||||
outstring.append(param + str(int(c.Parameters['H'])))
|
||||
elif param == 'D':
|
||||
outstring.append(param + str(int(c.Parameters['D'])))
|
||||
elif param == 'S':
|
||||
outstring.append(param + str(int(c.Parameters['S'])))
|
||||
currentSpeed = int(c.Parameters['S'])
|
||||
else:
|
||||
if (not OUTPUT_DOUBLES) and (param in currLocation) and (currLocation[param] == c.Parameters[param]):
|
||||
continue
|
||||
else:
|
||||
pos = Units.Quantity(c.Parameters[param], FreeCAD.Units.Length)
|
||||
outstring.append(
|
||||
param + format(float(pos.getValueAs(UNIT_FORMAT)), precision_string))
|
||||
|
||||
if adaptiveOp and c.Name in ["G0", "G00"]:
|
||||
if opHorizRapid and opVertRapid:
|
||||
if 'Z' not in c.Parameters:
|
||||
outstring.append('F' + format(float(opHorizRapid.getValueAs(UNIT_SPEED_FORMAT)), precision_string))
|
||||
else:
|
||||
outstring.append('F' + format(float(opVertRapid.getValueAs(UNIT_SPEED_FORMAT)), precision_string))
|
||||
|
||||
# store the latest command
|
||||
lastcommand = command
|
||||
currLocation.update(c.Parameters)
|
||||
|
||||
# Check for Tool Change:
|
||||
if command == 'M6':
|
||||
# stop the spindle
|
||||
currentSpeed = 0
|
||||
out += linenumber() + "M5\n"
|
||||
for line in TOOL_CHANGE.splitlines(True):
|
||||
out += linenumber() + line
|
||||
|
||||
# add height offset
|
||||
if USE_TLO:
|
||||
tool_height = '\nG43 H' + str(int(c.Parameters['T']))
|
||||
outstring.append(tool_height)
|
||||
|
||||
if command == "message":
|
||||
if OUTPUT_COMMENTS is False:
|
||||
out = []
|
||||
else:
|
||||
outstring.pop(0) # remove the command
|
||||
|
||||
# prepend a line number and append a newline
|
||||
if len(outstring) >= 1:
|
||||
if OUTPUT_LINE_NUMBERS:
|
||||
outstring.insert(0, (linenumber()))
|
||||
|
||||
# append the line to the final output
|
||||
for w in outstring:
|
||||
out += w.upper() + COMMAND_SPACE
|
||||
out = out.strip() + "\n"
|
||||
|
||||
return out
|
||||
|
||||
# print(__name__ + " gcode postprocessor loaded.")
|
||||
@@ -384,7 +384,7 @@ def export(objectslist, filename, argstring):
|
||||
# #\better: append iff MODAL == False
|
||||
# if command == lastcommand:
|
||||
# outstring.pop(0)
|
||||
if c.Parameters >= 1:
|
||||
if len(c.Parameters) >= 1:
|
||||
for param in params:
|
||||
# test print("param: " + param + ", command: " + command)
|
||||
if param in c.Parameters:
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
#include <Gui/Selection.h>
|
||||
#include <boost_signals2.hpp>
|
||||
|
||||
class Ui_TaskSketcherGeneral;
|
||||
|
||||
namespace App {
|
||||
class Property;
|
||||
}
|
||||
@@ -40,6 +38,7 @@ class ViewProvider;
|
||||
|
||||
namespace SketcherGui {
|
||||
|
||||
class Ui_TaskSketcherGeneral;
|
||||
class ViewProviderSketch;
|
||||
|
||||
class SketcherGeneralWidget : public QWidget
|
||||
|
||||
@@ -20,6 +20,6 @@
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
import FreeCAD,FreeCADGui
|
||||
import FreeCAD
|
||||
rf=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Start")
|
||||
rf.SetBool("AllowDownload",True)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#* *
|
||||
#***************************************************************************
|
||||
|
||||
import FreeCADGui,sys
|
||||
import FreeCADGui
|
||||
# MRU will be given before this script is run
|
||||
rf=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles")
|
||||
FreeCADGui.loadFile(rf.GetString("MRU"+str(MRU)))
|
||||
|
||||
@@ -31,7 +31,7 @@ function load() {
|
||||
|
||||
if (allowDownloads == 1) {
|
||||
// load latest commits
|
||||
ddiv = document.getElementById("commits");
|
||||
var ddiv = document.getElementById("commits");
|
||||
ddiv.innerHTML = "Connecting...";
|
||||
var tobj=new JSONscriptRequest('https://api.github.com/repos/FreeCAD/FreeCAD/commits?callback=printCommits');
|
||||
tobj.buildScriptTag(); // Build the script tag
|
||||
@@ -61,7 +61,7 @@ function printCommits(data) {
|
||||
|
||||
// json callback for git commits
|
||||
|
||||
ddiv = document.getElementById('commits');
|
||||
var ddiv = document.getElementById('commits');
|
||||
ddiv.innerHTML = "Received";
|
||||
var html = ['<ul>'];
|
||||
for (var i = 0; i < 25; i++) {
|
||||
@@ -76,7 +76,7 @@ function printAddons(data) {
|
||||
|
||||
// json callback for addons list
|
||||
|
||||
ddiv = document.getElementById('addons');
|
||||
var ddiv = document.getElementById('addons');
|
||||
ddiv.innerHTML = "Received";
|
||||
var html = ['<ul class="addonslist">'];
|
||||
var blacklist = ['addons_installer.FCMacro','FreeCAD-Addon-Details.md','README.md'];
|
||||
@@ -98,7 +98,7 @@ function printForum(data) {
|
||||
|
||||
// json callback for forum posts
|
||||
|
||||
ddiv = document.getElementById('forum');
|
||||
var ddiv = document.getElementById('forum');
|
||||
ddiv.innerHTML = "Received";
|
||||
var html = ['<ul>'];
|
||||
for (var i = 0; i < 25; i++) {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
# the html code of the start page. It is built only once per FreeCAD session for now...
|
||||
|
||||
import six
|
||||
import sys,os,FreeCAD,FreeCADGui,tempfile,time,zipfile,urllib,re
|
||||
import sys,os,FreeCAD,FreeCADGui,tempfile,time,zipfile,re
|
||||
from . import TranslationTexts
|
||||
from PySide import QtCore,QtGui
|
||||
|
||||
@@ -107,7 +107,7 @@ def getInfo(filename):
|
||||
try:
|
||||
import gnome.ui
|
||||
import gnomevfs
|
||||
except:
|
||||
except Exception:
|
||||
# alternative method
|
||||
import hashlib
|
||||
fhash = hashlib.md5(("file://"+path).encode("utf8")).hexdigest()
|
||||
@@ -140,7 +140,7 @@ def getInfo(filename):
|
||||
if filename.lower().endswith(".fcstd"):
|
||||
try:
|
||||
zfile=zipfile.ZipFile(filename)
|
||||
except:
|
||||
except Exception:
|
||||
print("Cannot read file: ",filename)
|
||||
return None
|
||||
files=zfile.namelist()
|
||||
@@ -366,7 +366,6 @@ def handle():
|
||||
|
||||
# build SECTION_RECENTFILES
|
||||
|
||||
SECTION_RECENTFILES = encode("")
|
||||
rf = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/RecentFiles")
|
||||
rfcount = rf.GetInt("RecentFiles",0)
|
||||
SECTION_RECENTFILES = encode("<h2>"+TranslationTexts.T_RECENTFILES+"</h2>")
|
||||
@@ -493,7 +492,7 @@ def handle():
|
||||
img = os.path.join(resources_dir,"images/freecad.png")
|
||||
iconbank[wb] = img
|
||||
UL_WORKBENCHES += '<li>'
|
||||
UL_WORKBENCHES += '<img src="file:///'+iconbank[wb]+'"> '
|
||||
UL_WORKBENCHES += '<img src="file:///'+img+'"> '
|
||||
UL_WORKBENCHES += '<a href="https://www.freecadweb.org/wiki/'+wn+'_Workbench">'+wn.replace("ReverseEngineering","ReverseEng")+'</a>'
|
||||
UL_WORKBENCHES += '</li>'
|
||||
UL_WORKBENCHES += '</ul>'
|
||||
@@ -503,19 +502,19 @@ def handle():
|
||||
|
||||
try:
|
||||
import dxfLibrary
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
wblist.append("dxf-library")
|
||||
try:
|
||||
import RebarTools
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
wblist.append("reinforcement")
|
||||
try:
|
||||
import CADExchangerIO
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
wblist.append("cadexchanger")
|
||||
|
||||
@@ -171,7 +171,7 @@ CmdSurfaceGeomFillSurface::CmdSurfaceGeomFillSurface()
|
||||
sToolTipText = QT_TR_NOOP("Creates a surface from two, three or four boundary edges.");
|
||||
sWhatsThis = "Surface_GeomFillSurface";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Surface_BSplineSurface";
|
||||
sPixmap = "Surface_GeomFillSurface";
|
||||
}
|
||||
|
||||
bool CmdSurfaceGeomFillSurface::isActive(void)
|
||||
@@ -237,7 +237,7 @@ CmdSurfaceExtendFace::CmdSurfaceExtendFace()
|
||||
"with its local U and V parameters.");
|
||||
sWhatsThis = "Surface_ExtendFace";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Surface_Extend";
|
||||
sPixmap = "Surface_ExtendFace";
|
||||
}
|
||||
|
||||
void CmdSurfaceExtendFace::activated(int)
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
<file>icons/Surface_BSplineSurface.svg</file>
|
||||
<file>icons/Surface_CurveOnMesh.svg</file>
|
||||
<file>icons/Surface_Cut.svg</file>
|
||||
<file>icons/Surface_Extend.svg</file>
|
||||
<file>icons/Surface_ExtendFace.svg</file>
|
||||
<file>icons/Surface_Filling.svg</file>
|
||||
<file>icons/Surface_GeomFillSurface.svg</file>
|
||||
<file>icons/Surface_Sections.svg</file>
|
||||
<file>icons/Surface_Sewing.svg</file>
|
||||
<file>icons/Surface_Surface.svg</file>
|
||||
|
||||
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 6.5 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 187 KiB |
211
src/Mod/Surface/Gui/Resources/icons/Surface_ExtendFace.svg
Normal file
@@ -0,0 +1,211 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
id="svg2985"
|
||||
height="64px"
|
||||
width="64px">
|
||||
<title
|
||||
id="title889">Surface_ExtendFace</title>
|
||||
<defs
|
||||
id="defs2987">
|
||||
<linearGradient
|
||||
id="linearGradient4387">
|
||||
<stop
|
||||
id="stop4389"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop4391"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient6321">
|
||||
<stop
|
||||
id="stop6323"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop6325"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
gradientTransform="translate(-0.23443224,0.23443198)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="19.467436"
|
||||
fy="28.869568"
|
||||
fx="45.883327"
|
||||
cy="28.869568"
|
||||
cx="45.883327"
|
||||
id="radialGradient3692"
|
||||
xlink:href="#linearGradient3377" />
|
||||
<linearGradient
|
||||
id="linearGradient3377">
|
||||
<stop
|
||||
style="stop-color:#faff2b;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3379" />
|
||||
<stop
|
||||
style="stop-color:#ffaa00;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3381" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3377-3">
|
||||
<stop
|
||||
style="stop-color:#faff2b;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3379-8" />
|
||||
<stop
|
||||
style="stop-color:#ffaa00;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3381-3" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="19.467436"
|
||||
fy="28.869568"
|
||||
fx="45.883327"
|
||||
cy="28.869568"
|
||||
cx="45.883327"
|
||||
gradientTransform="matrix(0.67067175,0,0,0.64145918,-63.380792,0.83845403)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient6412"
|
||||
xlink:href="#linearGradient3377-3" />
|
||||
<linearGradient
|
||||
id="linearGradient3036">
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3038" />
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3040" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="matrix(0.96812402,0,0,0.96755864,-0.72057496,-2.6783592)"
|
||||
xlink:href="#linearGradient1189"
|
||||
id="linearGradient2095"
|
||||
x1="47"
|
||||
y1="9"
|
||||
x2="7"
|
||||
y2="28"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient1189">
|
||||
<stop
|
||||
style="stop-color:#204a87;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop1185" />
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop1187" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata2990">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Surface_ExtendFace</dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>[bitacovir]</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:title>Part_Shape_from_Mesh</dc:title>
|
||||
<dc:date>2020/10/03</dc:date>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier />
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD LGPL2+</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>surface</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<dc:description />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1">
|
||||
<path
|
||||
style="display:inline;fill:url(#linearGradient2095);fill-opacity:1;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 3.1519208,24.413282 17.899691,60.320494 c 14.52186,-34.832109 31.154371,7.93994 42.771854,-25.924611 L 38.972508,3.1269928 C 30.809307,30.407148 17.749067,-0.16084869 3.1519208,24.413282 Z"
|
||||
id="path3820-1-9" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="M 13.603223,48.657681 Z"
|
||||
id="path864" />
|
||||
<path
|
||||
id="path3820-1-9-6"
|
||||
d="M 5.3492197,24.626663 18.113409,55.643482 C 32.677175,26.678261 49.470489,63.641047 58.406281,34.501823 L 39.63819,7.4361573 C 30.967406,29.589343 16.774125,4.5857267 5.3492197,24.626663 Z"
|
||||
style="display:inline;fill:none;fill-opacity:1;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 9.4369591,17.432017 23.893747,49.402887"
|
||||
id="path858" />
|
||||
<path
|
||||
style="fill:none;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 40.112066,21.625636 6.018626,-7.896527"
|
||||
id="path868" />
|
||||
<path
|
||||
style="fill:none;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 34.776081,12.780487 54.665726,44.771608"
|
||||
id="path860" />
|
||||
<path
|
||||
style="fill:none;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 14.039223,26.683244 7.5864126,33.920856"
|
||||
id="path862" />
|
||||
<path
|
||||
style="fill:none;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 20.840834,39.937666 13.516022,48.22168"
|
||||
id="path866" />
|
||||
<path
|
||||
style="fill:none;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 48.04728,34.356857 6.490744,-8.440886"
|
||||
id="path870" />
|
||||
<path
|
||||
id="path856-7"
|
||||
d="m 14.039223,26.770444 6.278411,13.690423 c 11.170658,-12.42446 17.282205,3.65439 28.078446,-6.01681 L 39.937666,21.102435 c -9.271964,9.611298 -19.414292,-4.508807 -25.898443,5.668009 z"
|
||||
style="fill:none;stroke:#0b1521;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;stroke:#fce94f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 14.039223,26.770444 6.278411,13.690423 c 11.170658,-12.42446 17.282205,3.65439 28.078446,-6.01681 L 39.937666,21.102435 c -9.271964,9.611298 -19.414292,-4.508807 -25.898443,5.668009 z"
|
||||
id="path856" />
|
||||
<path
|
||||
style="fill:none;stroke:#204a87;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 42.16127,29.233848 -2.790405,-4.360007 c -3.15688,2.379363 -6.869436,2.749406 -10.703817,1.983804"
|
||||
id="path889" />
|
||||
<path
|
||||
style="fill:none;stroke:#204a87;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 22.650238,41.703469 c 4.877832,-5.031355 7.162943,-3.688493 11.706619,-2.746805"
|
||||
id="path891" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 6.1 KiB |
171
src/Mod/Surface/Gui/Resources/icons/Surface_GeomFillSurface.svg
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
id="svg2985"
|
||||
height="64px"
|
||||
width="64px">
|
||||
<title
|
||||
id="title889">Surface_GeomFillSurface</title>
|
||||
<defs
|
||||
id="defs2987">
|
||||
<linearGradient
|
||||
id="linearGradient4387">
|
||||
<stop
|
||||
id="stop4389"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop4391"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient6321">
|
||||
<stop
|
||||
id="stop6323"
|
||||
offset="0"
|
||||
style="stop-color:#71b2f8;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop6325"
|
||||
offset="1"
|
||||
style="stop-color:#002795;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
gradientTransform="translate(-0.23443224,0.23443198)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
r="19.467436"
|
||||
fy="28.869568"
|
||||
fx="45.883327"
|
||||
cy="28.869568"
|
||||
cx="45.883327"
|
||||
id="radialGradient3692"
|
||||
xlink:href="#linearGradient3377" />
|
||||
<linearGradient
|
||||
id="linearGradient3377">
|
||||
<stop
|
||||
style="stop-color:#faff2b;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3379" />
|
||||
<stop
|
||||
style="stop-color:#ffaa00;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3381" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3377-3">
|
||||
<stop
|
||||
style="stop-color:#faff2b;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3379-8" />
|
||||
<stop
|
||||
style="stop-color:#ffaa00;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3381-3" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
r="19.467436"
|
||||
fy="28.869568"
|
||||
fx="45.883327"
|
||||
cy="28.869568"
|
||||
cx="45.883327"
|
||||
gradientTransform="matrix(0.67067175,0,0,0.64145918,-63.380792,0.83845403)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient6412"
|
||||
xlink:href="#linearGradient3377-3" />
|
||||
<linearGradient
|
||||
id="linearGradient3036">
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3038" />
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3040" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="matrix(0.96812402,0,0,0.96755864,-0.72057496,-2.6783592)"
|
||||
xlink:href="#linearGradient1189"
|
||||
id="linearGradient2095"
|
||||
x1="47"
|
||||
y1="9"
|
||||
x2="7"
|
||||
y2="28"
|
||||
gradientUnits="userSpaceOnUse" />
|
||||
<linearGradient
|
||||
id="linearGradient1189">
|
||||
<stop
|
||||
style="stop-color:#204a87;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop1185" />
|
||||
<stop
|
||||
style="stop-color:#729fcf;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop1187" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<metadata
|
||||
id="metadata2990">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>Surface_GeomFillSurface</dc:title>
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>[bitacovir]</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:title>Part_Shape_from_Mesh</dc:title>
|
||||
<dc:date>2020/10/03</dc:date>
|
||||
<dc:relation>http://www.freecadweb.org/wiki/index.php?title=Artwork</dc:relation>
|
||||
<dc:publisher>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:publisher>
|
||||
<dc:identifier />
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>FreeCAD LGPL2+</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
<cc:license>https://www.gnu.org/copyleft/lesser.html</cc:license>
|
||||
<dc:contributor>
|
||||
<cc:Agent>
|
||||
<dc:title />
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
<dc:subject>
|
||||
<rdf:Bag>
|
||||
<rdf:li>surface</rdf:li>
|
||||
</rdf:Bag>
|
||||
</dc:subject>
|
||||
<dc:description />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1">
|
||||
<path
|
||||
style="display:inline;fill:url(#linearGradient2095);fill-opacity:1;stroke:#302b00;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 3.1519208,24.413282 17.899691,60.320494 c 14.52186,-34.832109 31.154371,7.93994 42.771854,-25.924611 L 38.972508,3.1269928 C 30.809307,30.407148 17.749067,-0.16084869 3.1519208,24.413282 Z"
|
||||
id="path3820-1-9" />
|
||||
<path
|
||||
id="path3820-1-9-6"
|
||||
d="M 6.0274776,24.811642 18.175069,54.286966 C 33.540412,25.445065 49.03887,62.222871 57.666363,34.995102 L 39.76151,8.7926732 C 30.227488,30.267601 17.452383,4.7707061 6.0274776,24.811642 Z"
|
||||
style="display:inline;fill:none;fill-opacity:1;stroke:#fce94f;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
id="path857"
|
||||
d="M 8.3549048,24.972224 18.621264,49.266191 C 31.716699,27.213603 50.17526,55.741537 55.247193,35.269413 L 40.202199,12.856071 C 30.336022,29.759966 16.753608,10.080699 8.3549048,24.972224 Z"
|
||||
style="fill:none;stroke:#302b00;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -183,11 +183,13 @@ CmdTechDrawPageTemplate::CmdTechDrawPageTemplate()
|
||||
void CmdTechDrawPageTemplate::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
QString work_dir = Gui::FileDialog::getWorkingDirectory();
|
||||
QString templateDir = Preferences::defaultTemplateDir();
|
||||
QString templateFileName = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
|
||||
QString::fromUtf8(QT_TR_NOOP("Select a Template File")),
|
||||
templateDir,
|
||||
QString::fromUtf8(QT_TR_NOOP("Template (*.svg *.dxf)")));
|
||||
Gui::FileDialog::setWorkingDirectory(work_dir); // Don't overwrite WD with templateDir
|
||||
|
||||
if (templateFileName.isEmpty()) {
|
||||
return;
|
||||
|
||||