Sketcher - Add new Split Edge action
This commit is contained in:
committed by
abdullahtahiriyo
parent
ae0a31542f
commit
4d6b1f3eb8
@@ -684,7 +684,7 @@ bool GeomCurve::normalAt(double u, Base::Vector3d& dir) const
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GeomCurve::intersect( GeomCurve * c,
|
||||
bool GeomCurve::intersect( const GeomCurve *c,
|
||||
std::vector<std::pair<Base::Vector3d, Base::Vector3d>>& points,
|
||||
double tol) const
|
||||
{
|
||||
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
double curvatureAt(double u) const;
|
||||
double length(double u, double v) const;
|
||||
bool normalAt(double u, Base::Vector3d& dir) const;
|
||||
bool intersect(GeomCurve * c,
|
||||
bool intersect(const GeomCurve *c,
|
||||
std::vector<std::pair<Base::Vector3d, Base::Vector3d>>& points,
|
||||
double tol = Precision::Confusion()) const;
|
||||
|
||||
|
||||
@@ -1647,7 +1647,7 @@ void SketchObject::transferFilletConstraints(int geoId1, PointPos posId1, int ge
|
||||
this->Constraints.setValues(std::move(newConstraints));
|
||||
}
|
||||
|
||||
int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toGeoId, PointPos toPosId)
|
||||
int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toGeoId, PointPos toPosId, bool tangencyHolds)
|
||||
{
|
||||
Base::StateLocker lock(managedoperation, true); // no need to check input data validity as this is an sketchobject managed operation.
|
||||
|
||||
@@ -1659,15 +1659,17 @@ int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toG
|
||||
!(vals[i]->Second == toGeoId && vals[i]->SecondPos == toPosId) &&
|
||||
!(toGeoId < 0 && vals[i]->Second <0) ) {
|
||||
|
||||
// Nothing guarantees that a tangent can be freely transferred to another coincident point, as
|
||||
// the transfer destination edge most likely won't be intended to be tangent. However, if it is
|
||||
// an end to end point tangency, the user expects it to be substituted by a coincidence constraint.
|
||||
std::unique_ptr<Constraint> constNew(newVals[i]->clone());
|
||||
constNew->First = toGeoId;
|
||||
constNew->FirstPos = toPosId;
|
||||
|
||||
if(vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular){
|
||||
constNew->Type = Sketcher::Coincident;
|
||||
// If not explicitly confirmed, nothing guarantees that a tangent can be freely transferred to another coincident
|
||||
// point, as the transfer destination edge most likely won't be intended to be tangent. However, if it is
|
||||
// an end to end point tangency, the user expects it to be substituted by a coincidence constraint.
|
||||
if (vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular) {
|
||||
if (!tangencyHolds) {
|
||||
constNew->Type = Sketcher::Coincident;
|
||||
}
|
||||
}
|
||||
// With respect to angle constraints, if it is a DeepSOIC style angle constraint (segment+segment+point),
|
||||
// then no problem arises as the segments are PosId=none. In this case there is no call to this function.
|
||||
@@ -1690,11 +1692,13 @@ int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toG
|
||||
std::unique_ptr<Constraint> constNew(newVals[i]->clone());
|
||||
constNew->Second = toGeoId;
|
||||
constNew->SecondPos = toPosId;
|
||||
// Nothing guarantees that a tangent can be freely transferred to another coincident point, as
|
||||
// the transfer destination edge most likely won't be intended to be tangent. However, if it is
|
||||
// If not explicitly confirmed, nothing guarantees that a tangent can be freely transferred to another coincident
|
||||
// point, as the transfer destination edge most likely won't be intended to be tangent. However, if it is
|
||||
// an end to end point tangency, the user expects it to be substituted by a coincidence constraint.
|
||||
if(vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular) {
|
||||
constNew->Type = Sketcher::Coincident;
|
||||
if (vals[i]->Type == Sketcher::Tangent || vals[i]->Type == Sketcher::Perpendicular) {
|
||||
if (!tangencyHolds) {
|
||||
constNew->Type = Sketcher::Coincident;
|
||||
}
|
||||
}
|
||||
else if(vals[i]->Type == Sketcher::Angle) {
|
||||
continue;
|
||||
@@ -1713,6 +1717,19 @@ int SketchObject::transferConstraints(int fromGeoId, PointPos fromPosId, int toG
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SketchObject::swapInvolvedGeometry(Constraint *constraint, int fromGeoId, int toGeoId)
|
||||
{
|
||||
if (constraint->First == fromGeoId) {
|
||||
constraint->First = toGeoId;
|
||||
}
|
||||
if (constraint->Second == fromGeoId) {
|
||||
constraint->Second = toGeoId;
|
||||
}
|
||||
if (constraint->Third == fromGeoId) {
|
||||
constraint->Third = toGeoId;
|
||||
}
|
||||
}
|
||||
|
||||
int SketchObject::fillet(int GeoId, PointPos PosId, double radius, bool trim, bool createCorner)
|
||||
{
|
||||
if (GeoId < 0 || GeoId > getHighestCurveIndex())
|
||||
@@ -2964,6 +2981,312 @@ int SketchObject::trim(int GeoId, const Base::Vector3d& point)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int SketchObject::split(int GeoId, const Base::Vector3d &point)
|
||||
{
|
||||
// No need to check input data validity as this is an sketchobject managed operation
|
||||
|
||||
Base::StateLocker lock(managedoperation, true);
|
||||
|
||||
if (GeoId < 0 || GeoId > getHighestCurveIndex()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
const Part::Geometry *geo = getGeometry(GeoId);
|
||||
std::vector<Part::Geometry *> newGeometries;
|
||||
std::vector<int> newIds;
|
||||
std::vector<Constraint *> newConstraints;
|
||||
bool ok = false;
|
||||
|
||||
Base::Vector3d startPoint, endPoint, splitPoint;
|
||||
double radius, startAngle, endAngle, splitAngle;
|
||||
unsigned int longestPart = 0;
|
||||
|
||||
do {
|
||||
if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
|
||||
const Part::GeomLineSegment *lineSegm = static_cast<const Part::GeomLineSegment *>(geo);
|
||||
|
||||
startPoint = lineSegm->getStartPoint();
|
||||
endPoint = lineSegm->getEndPoint();
|
||||
splitPoint = point.Perpendicular(startPoint, endPoint - startPoint);
|
||||
if ((endPoint - splitPoint).Length() > (splitPoint - startPoint).Length()) {
|
||||
longestPart = 1;
|
||||
}
|
||||
|
||||
Part::GeomLineSegment *newLine = static_cast<Part::GeomLineSegment *>(lineSegm->copy());
|
||||
newGeometries.push_back(newLine);
|
||||
|
||||
newLine->setPoints(startPoint, splitPoint);
|
||||
int newId = addGeometry(newLine);
|
||||
if (newId < 0) {
|
||||
continue;
|
||||
}
|
||||
newIds.push_back(newId);
|
||||
setConstruction(newId, GeometryFacade::getConstruction(geo));
|
||||
|
||||
newLine = static_cast<Part::GeomLineSegment *>(lineSegm->copy());
|
||||
newGeometries.push_back(newLine);
|
||||
|
||||
newLine->setPoints(splitPoint, endPoint);
|
||||
newId = addGeometry(newLine);
|
||||
if (newId < 0) {
|
||||
continue;
|
||||
}
|
||||
newIds.push_back(newId);
|
||||
setConstruction(newId, GeometryFacade::getConstruction(geo));
|
||||
|
||||
Constraint *joint = new Constraint();
|
||||
joint->Type = Coincident;
|
||||
joint->First = newIds[0];
|
||||
joint->FirstPos = end;
|
||||
joint->Second = newIds[1];
|
||||
joint->SecondPos = start;
|
||||
newConstraints.push_back(joint);
|
||||
|
||||
transferConstraints(GeoId, start, newIds[0], start, true);
|
||||
transferConstraints(GeoId, end, newIds[1], end, true);
|
||||
ok = true;
|
||||
}
|
||||
else if (geo->getTypeId() == Part::GeomCircle::getClassTypeId()) {
|
||||
const Part::GeomCircle *circle = static_cast<const Part::GeomCircle *>(geo);
|
||||
|
||||
Base::Vector3d center(circle->getLocation());
|
||||
Base::Vector3d dir(point - center);
|
||||
radius = circle->getRadius();
|
||||
|
||||
splitAngle = atan2(dir.y, dir.x);
|
||||
startAngle = splitAngle;
|
||||
endAngle = splitAngle + M_PI*2.0;
|
||||
|
||||
splitPoint = Base::Vector3d(center.x + radius*cos(splitAngle), center.y + radius*sin(splitAngle));
|
||||
startPoint = splitPoint;
|
||||
endPoint = splitPoint;
|
||||
|
||||
Part::GeomArcOfCircle *arc = new Part::GeomArcOfCircle();
|
||||
newGeometries.push_back(arc);
|
||||
|
||||
arc->setLocation(center);
|
||||
arc->setRadius(radius);
|
||||
arc->setRange(startAngle, endAngle, false);
|
||||
int arcId = addGeometry(arc);
|
||||
if (arcId < 0) {
|
||||
continue;
|
||||
}
|
||||
newIds.push_back(arcId);
|
||||
setConstruction(arcId, GeometryFacade::getConstruction(geo));
|
||||
|
||||
transferConstraints(GeoId, mid, arcId, mid);
|
||||
ok = true;
|
||||
}
|
||||
else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
const Part::GeomArcOfCircle *arc = static_cast<const Part::GeomArcOfCircle *>(geo);
|
||||
|
||||
startPoint = arc->getStartPoint();
|
||||
endPoint = arc->getEndPoint();
|
||||
|
||||
Base::Vector3d center(arc->getLocation());
|
||||
radius = arc->getRadius();
|
||||
arc->getRange(startAngle, endAngle, false);
|
||||
|
||||
Base::Vector3d dir(point - center);
|
||||
splitAngle = atan2(dir.y, dir.x);
|
||||
if (splitAngle < startAngle) {
|
||||
splitAngle += M_PI*2.0;
|
||||
}
|
||||
if (endAngle - splitAngle > splitAngle - startAngle) {
|
||||
longestPart = 1;
|
||||
}
|
||||
|
||||
splitPoint = Base::Vector3d(center.x + radius*cos(splitAngle), center.y + radius*sin(splitAngle));
|
||||
startPoint = splitPoint;
|
||||
endPoint = splitPoint;
|
||||
|
||||
Part::GeomArcOfCircle *newArc = static_cast<Part::GeomArcOfCircle *>(arc->copy());
|
||||
newGeometries.push_back(newArc);
|
||||
|
||||
newArc->setRange(startAngle, splitAngle, false);
|
||||
int newId = addGeometry(newArc);
|
||||
if (newId < 0) {
|
||||
continue;
|
||||
}
|
||||
newIds.push_back(newId);
|
||||
setConstruction(newId, GeometryFacade::getConstruction(geo));
|
||||
|
||||
newArc = static_cast<Part::GeomArcOfCircle *>(arc->copy());
|
||||
newGeometries.push_back(newArc);
|
||||
|
||||
newArc->setRange(splitAngle, endAngle, false);
|
||||
newId = addGeometry(newArc);
|
||||
if (newId < 0) {
|
||||
continue;
|
||||
}
|
||||
newIds.push_back(newId);
|
||||
setConstruction(newId, GeometryFacade::getConstruction(geo));
|
||||
|
||||
Constraint *joint = new Constraint();
|
||||
joint->Type = Coincident;
|
||||
joint->First = newIds[0];
|
||||
joint->FirstPos = end;
|
||||
joint->Second = newIds[1];
|
||||
joint->SecondPos = start;
|
||||
newConstraints.push_back(joint);
|
||||
|
||||
joint = new Constraint();
|
||||
joint->Type = Coincident;
|
||||
joint->First = newIds[0];
|
||||
joint->FirstPos = mid;
|
||||
joint->Second = newIds[1];
|
||||
joint->SecondPos = mid;
|
||||
newConstraints.push_back(joint);
|
||||
|
||||
transferConstraints(GeoId, start, newIds[0], start, true);
|
||||
transferConstraints(GeoId, mid, newIds[0], mid);
|
||||
transferConstraints(GeoId, end, newIds[1], end, true);
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
while (false);
|
||||
|
||||
if (ok) {
|
||||
std::vector<int> oldConstraints;
|
||||
getAppliedConstraints(GeoId, oldConstraints);
|
||||
|
||||
for (unsigned int i = 0; i < oldConstraints.size(); ++i) {
|
||||
|
||||
Constraint *con = this->Constraints.getValues()[oldConstraints[i]];
|
||||
int conId = con->First;
|
||||
PointPos conPos = con->FirstPos;
|
||||
if (conId == GeoId) {
|
||||
conId = con->Second;
|
||||
conPos = con->SecondPos;
|
||||
}
|
||||
|
||||
bool transferToAll = false;
|
||||
switch (con->Type) {
|
||||
case Horizontal:
|
||||
case Vertical:
|
||||
case Parallel: {
|
||||
transferToAll = geo->getTypeId() == Part::GeomLineSegment::getClassTypeId();
|
||||
break;
|
||||
}
|
||||
case Tangent:
|
||||
case Perpendicular: {
|
||||
unsigned int initial = 0;
|
||||
unsigned int limit = newIds.size();
|
||||
|
||||
if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
const Part::Geometry *conGeo = getGeometry(conId);
|
||||
if (conGeo && conGeo->isDerivedFrom(Part::GeomCurve::getClassTypeId())) {
|
||||
std::vector<std::pair<Base::Vector3d, Base::Vector3d>> intersections;
|
||||
bool intersects[2];
|
||||
|
||||
intersects[0] = static_cast<const Part::GeomCurve *>(newGeometries[0])->
|
||||
intersect(static_cast<const Part::GeomCurve *>(conGeo), intersections);
|
||||
intersects[1] = static_cast<const Part::GeomCurve *>(newGeometries[1])->
|
||||
intersect(static_cast<const Part::GeomCurve *>(conGeo), intersections);
|
||||
|
||||
initial = longestPart;
|
||||
if (intersects[0] != intersects[1]) {
|
||||
initial = intersects[1] ? 1 : 0;
|
||||
}
|
||||
limit = initial + 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (unsigned int i = initial; i < limit; ++i) {
|
||||
Constraint *trans = con->copy();
|
||||
swapInvolvedGeometry(trans, GeoId, newIds[i]);
|
||||
newConstraints.push_back(trans);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Distance:
|
||||
case DistanceX:
|
||||
case DistanceY:
|
||||
case PointOnObject: {
|
||||
if (con->FirstPos == none && con->SecondPos == none) {
|
||||
Constraint *dist = con->copy();
|
||||
dist->First = newIds[0];
|
||||
dist->FirstPos = start;
|
||||
dist->Second = newIds[1];
|
||||
dist->SecondPos = end;
|
||||
newConstraints.push_back(dist);
|
||||
}
|
||||
else {
|
||||
Constraint *trans = con->copy();
|
||||
trans->First = conId;
|
||||
trans->FirstPos = conPos;
|
||||
trans->SecondPos = none;
|
||||
|
||||
Base::Vector3d conPoint(getPoint(conId, conPos));
|
||||
int targetId = newIds[0];
|
||||
|
||||
if (geo->getTypeId() == Part::GeomLineSegment::getClassTypeId()) {
|
||||
Base::Vector3d projPoint(conPoint.Perpendicular(startPoint, endPoint - startPoint));
|
||||
Base::Vector3d splitDir = splitPoint - startPoint;
|
||||
if ((projPoint - startPoint)*splitDir > splitDir*splitDir) {
|
||||
targetId = newIds[1];
|
||||
}
|
||||
}
|
||||
else if (geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
Base::Vector3d conDir(conPoint - static_cast<const Part::GeomArcOfCircle *>(geo)->getLocation());
|
||||
double conAngle = atan2(conDir.y, conDir.x);
|
||||
if (conAngle < startAngle) {
|
||||
conAngle += M_PI*2.0;
|
||||
}
|
||||
if (conAngle > splitAngle) {
|
||||
targetId = newIds[1];
|
||||
}
|
||||
}
|
||||
trans->Second = targetId;
|
||||
|
||||
newConstraints.push_back(trans);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Radius:
|
||||
case Diameter:
|
||||
case Equal: {
|
||||
transferToAll = geo->getTypeId() == Part::GeomCircle::getClassTypeId()
|
||||
|| geo->getTypeId() == Part::GeomArcOfCircle::getClassTypeId();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Release other constraints
|
||||
break;
|
||||
}
|
||||
|
||||
if (transferToAll) {
|
||||
for (unsigned int i = 0; i < newIds.size(); ++i) {
|
||||
Constraint *trans = con->copy();
|
||||
swapInvolvedGeometry(trans, GeoId, newIds[i]);
|
||||
newConstraints.push_back(trans);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (noRecomputes) {
|
||||
solve();
|
||||
}
|
||||
|
||||
delConstraints(oldConstraints);
|
||||
addConstraints(newConstraints);
|
||||
}
|
||||
|
||||
for (std::vector<Part::Geometry *>::iterator it = newGeometries.begin(); it != newGeometries.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
for (std::vector<Constraint *>::iterator it = newConstraints.begin(); it != newConstraints.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
|
||||
if (ok) {
|
||||
delGeometry(GeoId);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool SketchObject::isExternalAllowed(App::Document *pDoc, App::DocumentObject *pObj, eReasonList* rsn) const
|
||||
{
|
||||
if (rsn)
|
||||
@@ -6826,6 +7149,19 @@ bool SketchObject::arePointsCoincident(int GeoId1, PointPos PosId1,
|
||||
return false;
|
||||
}
|
||||
|
||||
void SketchObject::getAppliedConstraints(int GeoId, std::vector<int> &constraintList)
|
||||
{
|
||||
const std::vector<Constraint *> &constraints = this->Constraints.getValues();
|
||||
int i = 0;
|
||||
|
||||
for (std::vector<Constraint *>::const_iterator it = constraints.begin(); it != constraints.end(); ++it) {
|
||||
if ((*it)->First == GeoId || (*it)->Second == GeoId || (*it)->Third == GeoId) {
|
||||
constraintList.push_back(i);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
void SketchObject::appendConflictMsg(const std::vector<int> &conflicting, std::string &msg)
|
||||
{
|
||||
appendConstraintsMsg(conflicting,
|
||||
|
||||
@@ -157,7 +157,12 @@ public:
|
||||
/// Deletes all constraints referencing an external geometry
|
||||
int delConstraintsToExternal();
|
||||
/// transfers all constraints of a point to a new point
|
||||
int transferConstraints(int fromGeoId, PointPos fromPosId, int toGeoId, PointPos toPosId);
|
||||
int transferConstraints(int fromGeoId, PointPos fromPosId, int toGeoId, PointPos toPosId,
|
||||
bool tangencyHolds = false);
|
||||
|
||||
/// swaps original GeoId for a new one
|
||||
void swapInvolvedGeometry(Constraint *constraint, int fromGeoId, int toGeoId);
|
||||
|
||||
/// Carbon copy another sketch geometry and constraints
|
||||
int carbonCopy(App::DocumentObject * pObj, bool construction = true);
|
||||
/// add an external geometry reference
|
||||
@@ -282,6 +287,8 @@ public:
|
||||
int trim(int geoId, const Base::Vector3d& point);
|
||||
/// extend a curve
|
||||
int extend(int geoId, double increment, int endPoint);
|
||||
/// split a curve
|
||||
int split(int geoId, const Base::Vector3d &point);
|
||||
|
||||
/// adds symmetric geometric elements with respect to the refGeoId (line or point)
|
||||
int addSymmetric(const std::vector<int> &geoIdList, int refGeoId, Sketcher::PointPos refPosId=Sketcher::none);
|
||||
@@ -358,6 +365,9 @@ public:
|
||||
void getDirectlyCoincidentPoints(int VertexId, std::vector<int> &GeoIdList, std::vector<PointPos> &PosIdList);
|
||||
bool arePointsCoincident(int GeoId1, PointPos PosId1, int GeoId2, PointPos PosId2);
|
||||
|
||||
/// fetches all constraints involving given GeoId
|
||||
void getAppliedConstraints(int GeoId, std::vector<int> &constraintList);
|
||||
|
||||
/// generates a warning message about constraint conflicts and appends it to the given message
|
||||
static void appendConflictMsg(const std::vector<int> &conflicting, std::string &msg);
|
||||
/// generates a warning message about redundant constraints and appends it to the given message
|
||||
|
||||
@@ -217,6 +217,11 @@ If there is no such constraint an exception is raised.
|
||||
<UserDocu>extend a curve to new start and end positions</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="split">
|
||||
<Documentation>
|
||||
<UserDocu>split a curve with a given id at a given reference point</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="addSymmetric">
|
||||
<Documentation>
|
||||
<UserDocu>add a symmetric geometric objects to the sketch with respect to a reference point or line</UserDocu>
|
||||
|
||||
@@ -570,7 +570,7 @@ PyObject* SketchObjectPy::delConstraintOnPoint(PyObject *args)
|
||||
if (!PyArg_ParseTuple(args, "i|i", &Index, &pos))
|
||||
return 0;
|
||||
|
||||
if (pos>=0 && pos<3) { // Sketcher::none Sketcher::mid
|
||||
if (pos>=0 && pos<=3) { // Sketcher::none Sketcher::mid
|
||||
if (this->getSketchObjectPtr()->delConstraintOnPoint(Index,(Sketcher::PointPos)pos)) {
|
||||
std::stringstream str;
|
||||
str << "Not able to delete a constraint on point with the given index: " << Index
|
||||
@@ -1120,6 +1120,25 @@ PyObject* SketchObjectPy::extend(PyObject *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* SketchObjectPy::split(PyObject *args)
|
||||
{
|
||||
PyObject *pcObj;
|
||||
int GeoId;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "iO!", &GeoId, &(Base::VectorPy::Type), &pcObj))
|
||||
return 0;
|
||||
|
||||
Base::Vector3d v1 = static_cast<Base::VectorPy*>(pcObj)->value();
|
||||
if (this->getSketchObjectPtr()->split(GeoId,v1)) {
|
||||
std::stringstream str;
|
||||
str << "Not able to split curve with the given index: " << GeoId;
|
||||
PyErr_SetString(PyExc_ValueError, str.str().c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyObject* SketchObjectPy::addSymmetric(PyObject *args)
|
||||
{
|
||||
PyObject *pcObj;
|
||||
|
||||
@@ -5904,6 +5904,125 @@ bool CmdSketcherExtend::isActive(void)
|
||||
}
|
||||
|
||||
|
||||
// ======================================================================================
|
||||
|
||||
namespace SketcherGui {
|
||||
class SplittingSelection : public Gui::SelectionFilterGate
|
||||
{
|
||||
App::DocumentObject* object;
|
||||
public:
|
||||
SplittingSelection(App::DocumentObject* obj)
|
||||
: Gui::SelectionFilterGate((Gui::SelectionFilter*)0), object(obj)
|
||||
{}
|
||||
|
||||
bool allow(App::Document * /*pDoc*/, App::DocumentObject *pObj, const char *sSubName)
|
||||
{
|
||||
if (pObj != this->object)
|
||||
return false;
|
||||
if (!sSubName || sSubName[0] == '\0')
|
||||
return false;
|
||||
std::string element(sSubName);
|
||||
if (element.substr(0,4) == "Edge") {
|
||||
int GeoId = std::atoi(element.substr(4,4000).c_str()) - 1;
|
||||
Sketcher::SketchObject *Sketch = static_cast<Sketcher::SketchObject*>(object);
|
||||
const Part::Geometry *geom = Sketch->getGeometry(GeoId);
|
||||
if (geom->getTypeId() == Part::GeomLineSegment::getClassTypeId()
|
||||
|| geom->getTypeId() == Part::GeomCircle::getClassTypeId()
|
||||
|| geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
class DrawSketchHandlerSplitting: public DrawSketchHandler
|
||||
{
|
||||
public:
|
||||
DrawSketchHandlerSplitting() {}
|
||||
virtual ~DrawSketchHandlerSplitting()
|
||||
{
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
}
|
||||
|
||||
virtual void activated(ViewProviderSketch *sketchgui)
|
||||
{
|
||||
Gui::Selection().clearSelection();
|
||||
Gui::Selection().rmvSelectionGate();
|
||||
Gui::Selection().addSelectionGate(new SplittingSelection(sketchgui->getObject()));
|
||||
setCrosshairCursor("Sketcher_Pointer_Splitting");
|
||||
}
|
||||
|
||||
virtual void mouseMove(Base::Vector2d onSketchPos)
|
||||
{
|
||||
Q_UNUSED(onSketchPos);
|
||||
}
|
||||
|
||||
virtual bool pressButton(Base::Vector2d onSketchPos)
|
||||
{
|
||||
Q_UNUSED(onSketchPos);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool releaseButton(Base::Vector2d onSketchPos)
|
||||
{
|
||||
int GeoId = sketchgui->getPreselectCurve();
|
||||
if (GeoId >= 0) {
|
||||
const Part::Geometry *geom = sketchgui->getSketchObject()->getGeometry(GeoId);
|
||||
if (geom->getTypeId() == Part::GeomLineSegment::getClassTypeId()
|
||||
|| geom->getTypeId() == Part::GeomCircle::getClassTypeId()
|
||||
|| geom->getTypeId() == Part::GeomArcOfCircle::getClassTypeId()) {
|
||||
try {
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Split edge"));
|
||||
Gui::cmdAppObjectArgs(sketchgui->getObject(), "split(%d,App.Vector(%f,%f,0))",
|
||||
GeoId, onSketchPos.x, onSketchPos.y);
|
||||
Gui::Command::commitCommand();
|
||||
tryAutoRecompute(static_cast<Sketcher::SketchObject *>(sketchgui->getObject()));
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
Base::Console().Error("Failed to split edge: %s\n", e.what());
|
||||
Gui::Command::abortCommand();
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
sketchgui->purgeHandler();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
DEF_STD_CMD_A(CmdSketcherSplit)
|
||||
|
||||
//TODO: fix the translations for this
|
||||
CmdSketcherSplit::CmdSketcherSplit()
|
||||
: Command("Sketcher_Split")
|
||||
{
|
||||
sAppModule = "Sketcher";
|
||||
sGroup = QT_TR_NOOP("Sketcher");
|
||||
sMenuText = QT_TR_NOOP("Split edge");
|
||||
sToolTipText = QT_TR_NOOP("Splits an edge into two while preserving constraints");
|
||||
sWhatsThis = "Sketcher_Split";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Sketcher_Split";
|
||||
sAccel = "T,S";
|
||||
eType = ForEdit;
|
||||
}
|
||||
|
||||
void CmdSketcherSplit::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
ActivateHandler(getActiveGuiDocument(), new DrawSketchHandlerSplitting());
|
||||
}
|
||||
|
||||
bool CmdSketcherSplit::isActive(void)
|
||||
{
|
||||
return isCreateGeoActive(getActiveGuiDocument());
|
||||
}
|
||||
|
||||
|
||||
namespace SketcherGui {
|
||||
class ExternalSelection : public Gui::SelectionFilterGate
|
||||
{
|
||||
@@ -7061,6 +7180,7 @@ void CreateSketcherCommandsCreateGeo(void)
|
||||
//rcCmdMgr.addCommand(new CmdSketcherCreateDraftLine());
|
||||
rcCmdMgr.addCommand(new CmdSketcherTrimming());
|
||||
rcCmdMgr.addCommand(new CmdSketcherExtend());
|
||||
rcCmdMgr.addCommand(new CmdSketcherSplit());
|
||||
rcCmdMgr.addCommand(new CmdSketcherExternal());
|
||||
rcCmdMgr.addCommand(new CmdSketcherCarbonCopy());
|
||||
}
|
||||
|
||||
@@ -161,6 +161,7 @@
|
||||
<file>icons/geometry/Sketcher_CreateTriangle_Constr.svg</file>
|
||||
<file>icons/geometry/Sketcher_Extend.svg</file>
|
||||
<file>icons/geometry/Sketcher_External.svg</file>
|
||||
<file>icons/geometry/Sketcher_Split.svg</file>
|
||||
<file>icons/geometry/Sketcher_ToggleConstruction.svg</file>
|
||||
<file>icons/geometry/Sketcher_Trimming.svg</file>
|
||||
</qresource>
|
||||
@@ -195,6 +196,7 @@
|
||||
<file>icons/pointers/Sketcher_Pointer_External.svg</file>
|
||||
<file>icons/pointers/Sketcher_Pointer_Regular_Polygon.svg</file>
|
||||
<file>icons/pointers/Sketcher_Pointer_Slot.svg</file>
|
||||
<file>icons/pointers/Sketcher_Pointer_Splitting.svg</file>
|
||||
<file>icons/pointers/Sketcher_Pointer_Trimming.svg</file>
|
||||
</qresource>
|
||||
<qresource>
|
||||
|
||||
671
src/Mod/Sketcher/Gui/Resources/icons/geometry/Sketcher_Split.svg
Normal file
671
src/Mod/Sketcher/Gui/Resources/icons/geometry/Sketcher_Split.svg
Normal file
@@ -0,0 +1,671 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<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"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="64px"
|
||||
height="64px"
|
||||
id="svg2726"
|
||||
sodipodi:version="0.32"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)"
|
||||
sodipodi:docname="Sketcher_Split.svg"
|
||||
inkscape:output_extension="org.inkscape.output.svg.inkscape"
|
||||
version="1.1">
|
||||
<defs
|
||||
id="defs2728">
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3144"
|
||||
id="radialGradient4274"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
cx="225.26402"
|
||||
cy="672.79736"
|
||||
fx="225.26402"
|
||||
fy="672.79736"
|
||||
r="34.345188" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
id="linearGradient3144">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3146" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="1"
|
||||
id="stop3148" />
|
||||
</linearGradient>
|
||||
<radialGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3144"
|
||||
id="radialGradient4272"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
cx="225.26402"
|
||||
cy="672.79736"
|
||||
fx="225.26402"
|
||||
fy="672.79736"
|
||||
r="34.345188" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
id="perspective2734" />
|
||||
<linearGradient
|
||||
id="linearGradient3836-0">
|
||||
<stop
|
||||
style="stop-color:#c4a000;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3838-2" />
|
||||
<stop
|
||||
style="stop-color:#fce94f;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3840-5" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3836-0-6"
|
||||
id="linearGradient3801-1-3"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="-18"
|
||||
y1="18"
|
||||
x2="-22"
|
||||
y2="5" />
|
||||
<linearGradient
|
||||
id="linearGradient3836-0-6">
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3838-2-7" />
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3840-5-5" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3836-0-6-6"
|
||||
id="linearGradient3801-1-3-3"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="-18"
|
||||
y1="18"
|
||||
x2="-22"
|
||||
y2="5" />
|
||||
<linearGradient
|
||||
id="linearGradient3836-0-6-6">
|
||||
<stop
|
||||
style="stop-color:#a40000;stop-opacity:1"
|
||||
offset="0"
|
||||
id="stop3838-2-7-7" />
|
||||
<stop
|
||||
style="stop-color:#ef2929;stop-opacity:1"
|
||||
offset="1"
|
||||
id="stop3840-5-5-5" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3836-0-6"
|
||||
id="linearGradient4808"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="-18"
|
||||
y1="18"
|
||||
x2="-22"
|
||||
y2="5" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient2378"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient2368"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient2370"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
id="perspective2877"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3649"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3651"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3653"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3675"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
id="perspective3685" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3718"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
id="perspective3728" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3718-3"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3675-9"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3649-7"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<inkscape:perspective
|
||||
sodipodi:type="inkscape:persp3d"
|
||||
inkscape:vp_x="0 : 0.5 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_z="1 : 0.5 : 1"
|
||||
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
|
||||
id="perspective3631" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3675-8"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient-1"
|
||||
y2="1.6356687"
|
||||
x2="5.9349073"
|
||||
y1="16.48678"
|
||||
x1="10.504496"
|
||||
gradientTransform="scale(0.99999018,1.0000098)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
id="stop5308"
|
||||
offset="0%"
|
||||
stop-color="#A40000" />
|
||||
<stop
|
||||
id="stop5310"
|
||||
offset="100%"
|
||||
stop-color="#EF2929" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3963"
|
||||
inkscape:collect="always">
|
||||
<stop
|
||||
id="stop3965"
|
||||
offset="0"
|
||||
style="stop-color:#3465a4;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3967"
|
||||
offset="1"
|
||||
style="stop-color:#729fcf;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3593">
|
||||
<stop
|
||||
id="stop3595"
|
||||
offset="0"
|
||||
style="stop-color:#c8e0f9;stop-opacity:1;" />
|
||||
<stop
|
||||
id="stop3597"
|
||||
offset="1"
|
||||
style="stop-color:#637dca;stop-opacity:1;" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
id="linearGradient3864">
|
||||
<stop
|
||||
style="stop-color:#71b2f8;stop-opacity:1;"
|
||||
offset="0"
|
||||
id="stop3866" />
|
||||
<stop
|
||||
style="stop-color:#002795;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3868" />
|
||||
</linearGradient>
|
||||
<inkscape:perspective
|
||||
id="perspective2690"
|
||||
inkscape:persp3d-origin="32 : 21.333333 : 1"
|
||||
inkscape:vp_z="64 : 32 : 1"
|
||||
inkscape:vp_y="0 : 1000 : 0"
|
||||
inkscape:vp_x="0 : 32 : 1"
|
||||
sodipodi:type="inkscape:persp3d" />
|
||||
<radialGradient
|
||||
r="19.571428"
|
||||
fy="23.807407"
|
||||
fx="51.105499"
|
||||
cy="23.807407"
|
||||
cx="51.105499"
|
||||
gradientTransform="matrix(0.18109531,0.09137083,-0.15787103,0.32469326,32.464746,9.2811914)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3000"
|
||||
xlink:href="#linearGradient3864"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="19.571428"
|
||||
fy="46.74614"
|
||||
fx="48.288067"
|
||||
cy="46.74614"
|
||||
cx="48.288067"
|
||||
gradientTransform="matrix(2.3717718,-0.01625344,0.00868111,1.0161176,-99.606007,-11.43255)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3003"
|
||||
xlink:href="#linearGradient3593"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="19.571428"
|
||||
fy="35.227276"
|
||||
fx="317.68173"
|
||||
cy="35.227276"
|
||||
cx="317.68173"
|
||||
gradientTransform="matrix(0.96213818,0,0,0.96213818,-277.85662,12.822261)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3006"
|
||||
xlink:href="#linearGradient3593"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="19.571428"
|
||||
fy="39.962704"
|
||||
fx="330.63791"
|
||||
cy="39.962704"
|
||||
cx="330.63791"
|
||||
gradientTransform="matrix(0.96213818,0,0,0.96213818,-309.82584,8.3614397)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3009"
|
||||
xlink:href="#linearGradient3593"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3016"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3803"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="19.571428"
|
||||
fy="46.74614"
|
||||
fx="48.288067"
|
||||
cy="46.74614"
|
||||
cx="48.288067"
|
||||
gradientTransform="matrix(2.2305904,-0.01528594,0.00816436,0.95563251,-83.981297,-71.598551)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3807"
|
||||
xlink:href="#linearGradient3864"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3821"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3821-5"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<radialGradient
|
||||
r="34.345188"
|
||||
fy="672.79736"
|
||||
fx="225.26402"
|
||||
cy="672.79736"
|
||||
cx="225.26402"
|
||||
gradientTransform="matrix(1,0,0,0.6985294,0,202.82863)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="radialGradient3803-9"
|
||||
xlink:href="#linearGradient3144"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
gradientUnits="userSpaceOnUse"
|
||||
y2="38"
|
||||
x2="-20"
|
||||
y1="35"
|
||||
x1="-13"
|
||||
id="linearGradient3969"
|
||||
xlink:href="#linearGradient3963"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
gradientTransform="rotate(15,69.468151,244.38323)"
|
||||
y2="37"
|
||||
x2="-19"
|
||||
y1="37"
|
||||
x1="-15"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient3978"
|
||||
xlink:href="#linearGradient3963"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1"
|
||||
inkscape:cx="-136.06382"
|
||||
inkscape:cy="175.01049"
|
||||
inkscape:current-layer="g3154"
|
||||
showgrid="true"
|
||||
inkscape:document-units="px"
|
||||
inkscape:grid-bbox="true"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1411"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:snap-nodes="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:snap-global="false">
|
||||
<inkscape:grid
|
||||
type="xygrid"
|
||||
id="grid2999"
|
||||
empspacing="2"
|
||||
visible="true"
|
||||
enabled="true"
|
||||
snapvisiblegridlinesonly="true" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata2731">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>[wmayer]</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:title></dc:title>
|
||||
<dc:date>2011-10-10</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>FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateLine.svg</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>[agryson] Alexander Gryson</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:contributor>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
id="layer1"
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
id="g4289"
|
||||
transform="matrix(0.1621282,0,0,0.1621282,6.3605986,-66.108806)">
|
||||
<g
|
||||
id="g3242">
|
||||
<g
|
||||
id="g3154"
|
||||
transform="matrix(-0.9996417,2.6765153e-2,-2.6765153e-2,-0.9996417,238.03783,1359.7845)"
|
||||
inkscape:export-filename="/home/yorik/Documents/Lab/Draft/icons/line.png"
|
||||
inkscape:export-xdpi="7.0721951"
|
||||
inkscape:export-ydpi="7.0721951">
|
||||
<g
|
||||
id="g5625">
|
||||
<g
|
||||
id="g5574" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3063"
|
||||
d="M 173.54199,651.07562 87.556655,732.57524"
|
||||
style="fill:none;stroke:#ffffff;stroke-width:12.33591747;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<g
|
||||
id="g5582">
|
||||
<path
|
||||
transform="translate(-2.5887148e-6,-1.6278964e-5)"
|
||||
sodipodi:nodetypes="ccccc"
|
||||
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:12.33591747;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 162.40856,627.63483 25.45866,26.85945 -97.662823,92.57154 -25.460812,-26.86174 z"
|
||||
id="path5287"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
transform="matrix(-6.1657491,-0.16508637,0.16508637,-6.1657491,251.65298,959.14094)"
|
||||
id="g3827-1-3">
|
||||
<g
|
||||
transform="translate(31.322131,40.570289)"
|
||||
id="g3797-9-5">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#280000;stroke-width:1.99999988000000006;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="path4250-71-6"
|
||||
d="M -26.156204,5.582626 A 8.993818,8.9934077 0.02042283 1 1 -12.493793,17.282241 8.993818,8.9934077 0.02042283 1 1 -26.156204,5.582626 z" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient3801-1-3);fill-opacity:1;stroke:#ef2929;stroke-width:1.99999952000000003;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="path4250-7-3-2"
|
||||
d="M -24.633588,6.893588 A 6.9999997,7.0000001 0 1 1 -14,16 6.9999997,7.0000001 0 0 1 -24.633588,6.893588 z" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3063-1"
|
||||
d="M 34.263683,783.08882 -83.375901,894.59313"
|
||||
style="fill:none;stroke:#ffffff;stroke-width:12.33591747;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
<g
|
||||
id="g5590">
|
||||
<g
|
||||
id="g5571">
|
||||
<path
|
||||
sodipodi:nodetypes="ccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3061"
|
||||
d="M 23.131004,759.64644 48.591816,786.50818 -80.727347,909.08082 -106.186,882.22137 Z"
|
||||
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:12.33591747;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
|
||||
</g>
|
||||
<g
|
||||
transform="matrix(-6.1657491,-0.16508637,0.16508637,-6.1657491,-1.5804401,1199.1674)"
|
||||
id="g3827-1-3-3">
|
||||
<g
|
||||
transform="translate(31.322131,40.570289)"
|
||||
id="g3797-9-5-5">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none;stroke:#280000;stroke-width:1.99999988;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="path4250-71-6-6"
|
||||
d="M -26.156204,5.582626 A 8.993818,8.9934077 0.02042283 1 1 -12.493793,17.282241 8.993818,8.9934077 0.02042283 1 1 -26.156204,5.582626 z" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient3801-1-3-3);fill-opacity:1;stroke:#ef2929;stroke-width:1.99999952;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
|
||||
id="path4250-7-3-2-2"
|
||||
d="M -24.633588,6.893588 A 6.9999997,7.0000001 0 1 1 -14,16 6.9999997,7.0000001 0 0 1 -24.633588,6.893588 z" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g5599">
|
||||
<g
|
||||
id="g4942"
|
||||
transform="translate(-109.2455,94.720058)">
|
||||
<g
|
||||
id="g3827-1-3-7"
|
||||
transform="matrix(-6.1657491,-0.16508637,0.16508637,-6.1657491,354.29343,1111.0482)">
|
||||
<g
|
||||
id="g3797-9-5-53"
|
||||
transform="translate(31.322131,40.570289)">
|
||||
<path
|
||||
d="M -26.156204,5.582626 A 8.993818,8.9934077 0.02042283 1 1 -12.493793,17.282241 8.993818,8.9934077 0.02042283 1 1 -26.156204,5.582626 Z"
|
||||
id="path4250-71-6-5"
|
||||
style="fill:none;stroke:#280000;stroke-width:1.99999988;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
d="M -24.633588,6.893588 A 6.9999997,7.0000001 0 1 1 -14,16 6.9999997,7.0000001 0 0 1 -24.633588,6.893588 Z"
|
||||
id="path4250-7-3-2-6"
|
||||
style="fill:url(#linearGradient4808);fill-opacity:1;stroke:#ef2929;stroke-width:1.99999952;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
id="g3971"
|
||||
transform="matrix(3.2431314,-5.2465049,5.2465049,3.2431314,-137.95207,940.74257)">
|
||||
<path
|
||||
sodipodi:nodetypes="cccccccc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3941"
|
||||
d="m 40,28 -3.863704,-1.035276 2.070553,-7.727407 -3.863704,-1.035276 7.607289,-5.208567 3.983821,8.314395 -3.863703,-1.035276 z"
|
||||
style="fill:url(#linearGradient3978);fill-opacity:1;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 23 KiB |
@@ -0,0 +1,98 @@
|
||||
<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
height="64"
|
||||
width="64"
|
||||
id="svg8"
|
||||
sodipodi:docname="Sketcher_Pointer_Split.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)">
|
||||
<metadata
|
||||
id="metadata14">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs12" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1411"
|
||||
id="namedview10"
|
||||
showgrid="false"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:object-paths="true"
|
||||
inkscape:snap-intersection-paths="true"
|
||||
inkscape:snap-smooth-nodes="true"
|
||||
inkscape:snap-midpoints="true"
|
||||
inkscape:zoom="7.375"
|
||||
inkscape:cx="57.65674"
|
||||
inkscape:cy="2.4410269"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg8" />
|
||||
<g
|
||||
id="symbol"
|
||||
style="fill:#cc0000;stroke:none;">
|
||||
<circle
|
||||
cx="32"
|
||||
cy="32"
|
||||
r="6"
|
||||
id="circle2" />
|
||||
</g>
|
||||
<g
|
||||
id="crosshair"
|
||||
style="stroke:#ffffff;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:miter;">
|
||||
<path
|
||||
d="m16,3v9m0,8v9m-13-13h9m8,0h9"
|
||||
id="path5" />
|
||||
</g>
|
||||
<circle
|
||||
style="fill:none;stroke:#cc0000;stroke-width:2"
|
||||
id="circle4755"
|
||||
r="5"
|
||||
cy="56"
|
||||
cx="26" />
|
||||
<circle
|
||||
style="fill:none;stroke:#cc0000;stroke-width:2"
|
||||
id="circle4757"
|
||||
r="5"
|
||||
cy="27"
|
||||
cx="56" />
|
||||
<path
|
||||
sodipodi:nodetypes="cc"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4792"
|
||||
d="M 26,56 38.245154,44.163018"
|
||||
style="fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
|
||||
<path
|
||||
style="fill:none;fill-rule:evenodd;stroke:#cc0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="M 43.754846,38.836982 56,27"
|
||||
id="path4794"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cc" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -265,6 +265,7 @@ inline void SketcherAddWorkbenchGeometries(T& geom)
|
||||
SketcherAddWorkspaceFillets(geom);
|
||||
geom << "Sketcher_Trimming"
|
||||
<< "Sketcher_Extend"
|
||||
<< "Sketcher_Split"
|
||||
<< "Sketcher_External"
|
||||
<< "Sketcher_CarbonCopy"
|
||||
<< "Sketcher_ToggleConstruction"
|
||||
|
||||
Reference in New Issue
Block a user