Sketcher: Line DSH

This commit is contained in:
Paddle
2023-10-16 15:50:40 +02:00
committed by abdullahtahiriyo
parent feb14870b6
commit 29f17f9c6d
7 changed files with 1654 additions and 132 deletions

View File

@@ -19,173 +19,708 @@
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef SKETCHERGUI_DrawSketchHandlerLine_H
#define SKETCHERGUI_DrawSketchHandlerLine_H
#include <Gui/Notifications.h>
#include "DrawSketchDefaultWidgetController.h"
#include "DrawSketchControllableHandler.h"
#include "GeometryCreationMode.h"
#include "Utils.h"
namespace SketcherGui
{
extern GeometryCreationMode geometryCreationMode; // defined in CommandCreateGeo.cpp
class DrawSketchHandlerLine: public DrawSketchHandler
class DrawSketchHandlerLine;
namespace ConstructionMethods
{
enum class LineConstructionMethod
{
OnePointLengthAngle,
OnePointLengthWidth,
TwoPoints,
End // Must be the last one
};
}
using DSHLineController =
DrawSketchDefaultWidgetController<DrawSketchHandlerLine,
/*SelectModeT*/ StateMachines::TwoSeekEnd,
/*PAutoConstraintSize =*/2,
/*OnViewParametersT =*/OnViewParameters<4, 4, 4>,
/*WidgetParametersT =*/WidgetParameters<0, 0, 0>,
/*WidgetCheckboxesT =*/WidgetCheckboxes<0, 0, 0>,
/*WidgetComboboxesT =*/WidgetComboboxes<1, 1, 1>,
ConstructionMethods::LineConstructionMethod,
/*bool PFirstComboboxIsConstructionMethod =*/true>;
using DSHLineControllerBase = DSHLineController::ControllerBase;
using DrawSketchHandlerLineBase = DrawSketchControllableHandler<DSHLineController>;
class DrawSketchHandlerLine: public DrawSketchHandlerLineBase
{
friend DSHLineController;
friend DSHLineControllerBase;
public:
DrawSketchHandlerLine()
: Mode(STATUS_SEEK_First)
, EditCurve(2)
{}
~DrawSketchHandlerLine() override
{}
/// mode table
enum SelectMode
{
STATUS_SEEK_First, /**< enum value ----. */
STATUS_SEEK_Second, /**< enum value ----. */
STATUS_End
};
DrawSketchHandlerLine(ConstructionMethod constrMethod = ConstructionMethod::OnePointLengthAngle)
: DrawSketchHandlerLineBase(constrMethod) {};
~DrawSketchHandlerLine() override = default;
void mouseMove(Base::Vector2d onSketchPos) override
private:
void updateDataAndDrawToPosition(Base::Vector2d onSketchPos) override
{
if (Mode == STATUS_SEEK_First) {
setPositionText(onSketchPos);
if (seekAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f))) {
renderSuggestConstraintsCursor(sugConstr1);
return;
}
}
else if (Mode == STATUS_SEEK_Second) {
float length = (onSketchPos - EditCurve[0]).Length();
float angle = (onSketchPos - EditCurve[0]).GetAngle(Base::Vector2d(1.f, 0.f));
if (showCursorCoords()) {
SbString text;
std::string lengthString = lengthToDisplayFormat(length, 1);
std::string angleString = angleToDisplayFormat(angle * 180.0 / M_PI, 1);
text.sprintf(" (%s, %s)", lengthString.c_str(), angleString.c_str());
setPositionText(onSketchPos, text);
}
switch (state()) {
case SelectMode::SeekFirst: {
startPoint = onSketchPos;
EditCurve[1] = onSketchPos;
drawEdit(EditCurve);
if (seekAutoConstraint(sugConstr2, onSketchPos, onSketchPos - EditCurve[0])) {
renderSuggestConstraintsCursor(sugConstr2);
return;
}
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
renderSuggestConstraintsCursor(sugConstraints[0]);
return;
}
} break;
case SelectMode::SeekSecond: {
endPoint = onSketchPos;
try {
CreateAndDrawShapeGeometry();
}
catch (const Base::ValueError&) {
} // equal points while hovering raise an objection that can be safely ignored
if (seekAutoConstraint(sugConstraints[1], onSketchPos, onSketchPos - startPoint)) {
renderSuggestConstraintsCursor(sugConstraints[1]);
return;
}
} break;
default:
break;
}
applyCursor();
}
bool pressButton(Base::Vector2d onSketchPos) override
void executeCommands() override
{
if (Mode == STATUS_SEEK_First) {
EditCurve[0] = onSketchPos;
try {
createShape(false);
setAngleSnapping(true, EditCurve[0]);
Mode = STATUS_SEEK_Second;
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch line"));
commandAddShapeGeometryAndConstraints();
Gui::Command::commitCommand();
}
catch (const Base::Exception& e) {
Gui::NotifyError(sketchgui,
QT_TRANSLATE_NOOP("Notifications", "Error"),
QT_TRANSLATE_NOOP("Notifications", "Failed to add line"));
Gui::Command::abortCommand();
THROWM(Base::RuntimeError,
QT_TRANSLATE_NOOP(
"Notifications",
"Tool execution aborted") "\n") // This prevents constraints from being
// applied on non existing geometry
}
}
void generateAutoConstraints() override
{
int LineGeoId = getHighestCurveIndex();
// Generate temporary autoconstraints (but do not actually add them to the sketch)
if (avoidRedundants) {
removeRedundantHorizontalVertical(getSketchObject(),
sugConstraints[0],
sugConstraints[1]);
}
auto& ac1 = sugConstraints[0];
auto& ac2 = sugConstraints[1];
generateAutoConstraintsOnElement(ac1, LineGeoId, Sketcher::PointPos::start);
generateAutoConstraintsOnElement(ac2, LineGeoId, Sketcher::PointPos::end);
// Ensure temporary autoconstraints do not generate a redundancy and that the geometry
// parameters are accurate This is particularly important for adding widget mandated
// constraints.
removeRedundantAutoConstraints();
}
void createAutoConstraints() override
{
// execute python command to create autoconstraints
createGeneratedAutoConstraints(true);
sugConstraints[0].clear();
sugConstraints[1].clear();
}
std::string getToolName() const override
{
return "DSH_Line";
}
QString getCrosshairCursorSVGName() const override
{
if (constructionMethod() == ConstructionMethod::OnePointLengthAngle) {
return QString::fromLatin1("Sketcher_Pointer_Create_Line_Polar");
}
else {
EditCurve[1] = onSketchPos;
drawEdit(EditCurve);
setAngleSnapping(false);
Mode = STATUS_End;
return QString::fromLatin1("Sketcher_Pointer_Create_Line.svg");
}
}
std::unique_ptr<QWidget> createWidget() const override
{
return std::make_unique<SketcherToolDefaultWidget>();
}
bool isWidgetVisible() const override
{
return true;
};
QPixmap getToolIcon() const override
{
return Gui::BitmapFactory().pixmap("Sketcher_CreateLine");
}
QString getToolWidgetText() const override
{
return QString(QObject::tr("Line parameters"));
}
bool canGoToNextMode() override
{
if (state() == SelectMode::SeekSecond && length < Precision::Confusion()) {
// Prevent validation of null line.
return false;
}
return true;
}
bool releaseButton(Base::Vector2d onSketchPos) override
void angleSnappingControl() override
{
Q_UNUSED(onSketchPos);
if (Mode == STATUS_End) {
unsetCursor();
resetPositionText();
try {
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Add sketch line"));
Gui::cmdAppObjectArgs(
sketchgui->getObject(),
"addGeometry(Part.LineSegment(App.Vector(%f,%f,0),App.Vector(%f,%f,0)),%s)",
EditCurve[0].x,
EditCurve[0].y,
EditCurve[1].x,
EditCurve[1].y,
geometryCreationMode == Construction ? "True" : "False");
Gui::Command::commitCommand();
}
catch (const Base::Exception&) {
Gui::NotifyError(sketchgui,
QT_TRANSLATE_NOOP("Notifications", "Error"),
QT_TRANSLATE_NOOP("Notifications", "Failed to add line"));
Gui::Command::abortCommand();
}
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath(
"User parameter:BaseApp/Preferences/Mod/Sketcher");
bool avoidredundant =
sketchgui->AvoidRedundant.getValue() && sketchgui->Autoconstraints.getValue();
if (avoidredundant) {
removeRedundantHorizontalVertical(
static_cast<Sketcher::SketchObject*>(sketchgui->getObject()),
sugConstr1,
sugConstr2);
}
// add auto constraints for the line segment start
if (!sugConstr1.empty()) {
createAutoConstraints(sugConstr1,
getHighestCurveIndex(),
Sketcher::PointPos::start);
sugConstr1.clear();
}
// add auto constraints for the line segment end
if (!sugConstr2.empty()) {
createAutoConstraints(sugConstr2, getHighestCurveIndex(), Sketcher::PointPos::end);
sugConstr2.clear();
}
tryAutoRecomputeIfNotSolve(
static_cast<Sketcher::SketchObject*>(sketchgui->getObject()));
EditCurve.clear();
drawEdit(EditCurve);
bool continuousMode = hGrp->GetBool("ContinuousCreationMode", true);
if (continuousMode) {
// This code enables the continuous creation mode.
Mode = STATUS_SEEK_First;
EditCurve.resize(2);
applyCursor();
/* It is ok not to call to purgeHandler
* in continuous creation mode because the
* handler is destroyed by the quit() method on pressing the
* right button of the mouse */
}
else {
sketchgui->purgeHandler(); // no code after this line, Handler get deleted in
// ViewProvider
}
if (state() == SelectMode::SeekSecond) {
setAngleSnapping(true, startPoint);
}
else {
setAngleSnapping(false);
}
return true;
}
private:
QString getCrosshairCursorSVGName() const override
Base::Vector2d startPoint, endPoint;
double length;
void createShape(bool onlyeditoutline) override
{
return QString::fromLatin1("Sketcher_Pointer_Create_Line");
Q_UNUSED(onlyeditoutline);
ShapeGeometry.clear();
Base::Vector2d vecL = endPoint - startPoint;
length = vecL.Length();
if (length > Precision::Confusion()) {
addLineToShapeGeometry(toVector3d(startPoint),
toVector3d(endPoint),
isConstructionMode());
}
}
};
template<>
auto DSHLineControllerBase::getState(int labelindex) const
{
switch (labelindex) {
case OnViewParameter::First:
case OnViewParameter::Second:
return SelectMode::SeekFirst;
break;
case OnViewParameter::Third:
case OnViewParameter::Fourth:
return SelectMode::SeekSecond;
break;
default:
THROWM(Base::ValueError, "Label index without an associated machine state")
}
}
template<>
void DSHLineController::configureToolWidget()
{
if (!init) { // Code to be executed only upon initialisation
QStringList names = {QStringLiteral("Point, length, angle"),
QStringLiteral("Point, length, width"),
QStringLiteral("2 points")};
toolWidget->setComboboxElements(WCombobox::FirstCombo, names);
if (isConstructionMode()) {
toolWidget->setComboboxItemIcon(
WCombobox::FirstCombo,
0,
Gui::BitmapFactory().iconFromTheme("Sketcher_CreateLineAngleLength_Constr"));
toolWidget->setComboboxItemIcon(
WCombobox::FirstCombo,
1,
Gui::BitmapFactory().iconFromTheme("Sketcher_CreateLineLengthWidth_Constr"));
toolWidget->setComboboxItemIcon(
WCombobox::FirstCombo,
2,
Gui::BitmapFactory().iconFromTheme("Sketcher_CreateLine_Constr"));
}
else {
toolWidget->setComboboxItemIcon(
WCombobox::FirstCombo,
0,
Gui::BitmapFactory().iconFromTheme("Sketcher_CreateLineAngleLength"));
toolWidget->setComboboxItemIcon(
WCombobox::FirstCombo,
1,
Gui::BitmapFactory().iconFromTheme("Sketcher_CreateLineLengthWidth"));
toolWidget->setComboboxItemIcon(
WCombobox::FirstCombo,
2,
Gui::BitmapFactory().iconFromTheme("Sketcher_CreateLine"));
}
}
protected:
SelectMode Mode;
std::vector<Base::Vector2d> EditCurve;
std::vector<AutoConstraint> sugConstr1, sugConstr2;
};
onViewParameters[OnViewParameter::First]->setLabelType(Gui::SoDatumLabel::DISTANCEX);
onViewParameters[OnViewParameter::Second]->setLabelType(Gui::SoDatumLabel::DISTANCEY);
if (handler->constructionMethod() == ConstructionMethod::OnePointLengthAngle) {
onViewParameters[OnViewParameter::Fourth]->setLabelType(Gui::SoDatumLabel::ANGLE);
}
else {
onViewParameters[OnViewParameter::Third]->setLabelType(Gui::SoDatumLabel::DISTANCEX);
onViewParameters[OnViewParameter::Fourth]->setLabelType(Gui::SoDatumLabel::DISTANCEY);
}
}
template<>
void DSHLineControllerBase::doEnforceControlParameters(Base::Vector2d& onSketchPos)
{
switch (handler->state()) {
case SelectMode::SeekFirst: {
if (onViewParameters[OnViewParameter::First]->isSet) {
onSketchPos.x = onViewParameters[OnViewParameter::First]->getValue();
}
if (onViewParameters[OnViewParameter::Second]->isSet) {
onSketchPos.y = onViewParameters[OnViewParameter::Second]->getValue();
}
} break;
case SelectMode::SeekSecond: {
if (handler->constructionMethod() == ConstructionMethod::OnePointLengthWidth) {
if (onViewParameters[OnViewParameter::Third]->isSet) {
onSketchPos.x = handler->startPoint.x
+ onViewParameters[OnViewParameter::Third]->getValue();
}
if (onViewParameters[OnViewParameter::Fourth]->isSet) {
onSketchPos.y = handler->startPoint.y
+ onViewParameters[OnViewParameter::Fourth]->getValue();
}
}
else if (handler->constructionMethod() == ConstructionMethod::OnePointLengthAngle) {
Base::Vector2d dir = onSketchPos - handler->startPoint;
double length = dir.Length();
if (onViewParameters[OnViewParameter::Third]->isSet) {
length = onViewParameters[OnViewParameter::Third]->getValue();
if (length < Precision::Confusion()) {
unsetOnViewParameter(onViewParameters[OnViewParameter::Third].get());
}
else {
if (dir.Length() < Precision::Confusion()) {
dir.x = 1; // if direction cannot be determined, default to (1,0)
}
onSketchPos = handler->startPoint + length * dir.Normalize();
}
}
if (onViewParameters[OnViewParameter::Fourth]->isSet) {
double angle =
onViewParameters[OnViewParameter::Fourth]->getValue() * M_PI / 180;
onSketchPos.x = handler->startPoint.x + cos(angle) * length;
onSketchPos.y = handler->startPoint.y + sin(angle) * length;
}
}
else {
if (onViewParameters[OnViewParameter::Third]->isSet) {
onSketchPos.x = onViewParameters[OnViewParameter::Third]->getValue();
}
if (onViewParameters[OnViewParameter::Fourth]->isSet) {
onSketchPos.y = onViewParameters[OnViewParameter::Fourth]->getValue();
}
}
} break;
default:
break;
}
}
template<>
void DSHLineController::adaptParameters(Base::Vector2d onSketchPos)
{
switch (handler->state()) {
case SelectMode::SeekFirst: {
if (!onViewParameters[OnViewParameter::First]->isSet) {
onViewParameters[OnViewParameter::First]->setSpinboxValue(onSketchPos.x);
}
if (!onViewParameters[OnViewParameter::Second]->isSet) {
onViewParameters[OnViewParameter::Second]->setSpinboxValue(onSketchPos.y);
}
bool sameSign = onSketchPos.x * onSketchPos.y > 0.;
onViewParameters[OnViewParameter::First]->setLabelAutoDistanceReverse(!sameSign);
onViewParameters[OnViewParameter::Second]->setLabelAutoDistanceReverse(sameSign);
onViewParameters[OnViewParameter::First]->setPoints(Base::Vector3d(),
toVector3d(onSketchPos));
onViewParameters[OnViewParameter::Second]->setPoints(Base::Vector3d(),
toVector3d(onSketchPos));
} break;
case SelectMode::SeekSecond: {
if (handler->constructionMethod() == ConstructionMethod::OnePointLengthWidth) {
Base::Vector3d start = toVector3d(handler->startPoint);
Base::Vector3d end = toVector3d(handler->endPoint);
Base::Vector3d vec = end - start;
if (!onViewParameters[OnViewParameter::Third]->isSet) {
onViewParameters[OnViewParameter::Third]->setSpinboxValue(vec.x);
}
if (!onViewParameters[OnViewParameter::Fourth]->isSet) {
onViewParameters[OnViewParameter::Fourth]->setSpinboxValue(vec.y);
}
bool sameSign = vec.x * vec.y > 0.;
onViewParameters[OnViewParameter::Third]->setLabelAutoDistanceReverse(!sameSign);
onViewParameters[OnViewParameter::Fourth]->setLabelAutoDistanceReverse(sameSign);
onViewParameters[OnViewParameter::Third]->setPoints(start, end);
onViewParameters[OnViewParameter::Fourth]->setPoints(start, end);
}
else if (handler->constructionMethod() == ConstructionMethod::OnePointLengthAngle) {
Base::Vector3d start = toVector3d(handler->startPoint);
Base::Vector3d end = toVector3d(handler->endPoint);
Base::Vector3d vec = end - start;
if (!onViewParameters[OnViewParameter::Third]->isSet) {
onViewParameters[OnViewParameter::Third]->setSpinboxValue(vec.Length());
}
double range = (handler->endPoint - handler->startPoint).Angle();
if (!onViewParameters[OnViewParameter::Fourth]->isSet) {
onViewParameters[OnViewParameter::Fourth]->setSpinboxValue(range * 180 / M_PI,
Base::Unit::Angle);
}
onViewParameters[OnViewParameter::Third]->setPoints(start, end);
onViewParameters[OnViewParameter::Fourth]->setPoints(start, Base::Vector3d());
onViewParameters[OnViewParameter::Fourth]->setLabelRange(range);
}
else {
if (!onViewParameters[OnViewParameter::Third]->isSet) {
onViewParameters[OnViewParameter::Third]->setSpinboxValue(onSketchPos.x);
}
if (!onViewParameters[OnViewParameter::Fourth]->isSet) {
onViewParameters[OnViewParameter::Fourth]->setSpinboxValue(onSketchPos.y);
}
bool sameSign = onSketchPos.x * onSketchPos.y > 0.;
onViewParameters[OnViewParameter::Third]->setLabelAutoDistanceReverse(!sameSign);
onViewParameters[OnViewParameter::Fourth]->setLabelAutoDistanceReverse(sameSign);
onViewParameters[OnViewParameter::Third]->setPoints(Base::Vector3d(),
toVector3d(onSketchPos));
onViewParameters[OnViewParameter::Fourth]->setPoints(Base::Vector3d(),
toVector3d(onSketchPos));
}
} break;
default:
break;
}
}
template<>
void DSHLineController::doChangeDrawSketchHandlerMode()
{
switch (handler->state()) {
case SelectMode::SeekFirst: {
if (onViewParameters[OnViewParameter::First]->isSet
&& onViewParameters[OnViewParameter::Second]->isSet) {
handler->setState(SelectMode::SeekSecond);
}
} break;
case SelectMode::SeekSecond: {
if (onViewParameters[OnViewParameter::Third]->isSet
&& onViewParameters[OnViewParameter::Fourth]->isSet) {
handler->setState(SelectMode::End);
}
} break;
default:
break;
}
}
// Function responsible to add widget mandated constraints (it is executed before creating
// autoconstraints)
template<>
void DSHLineController::addConstraints()
{
App::DocumentObject* obj = handler->sketchgui->getObject();
int firstCurve = handler->getHighestCurveIndex();
auto x0 = onViewParameters[OnViewParameter::First]->getValue();
auto y0 = onViewParameters[OnViewParameter::Second]->getValue();
auto p3 = onViewParameters[OnViewParameter::Third]->getValue();
auto p4 = onViewParameters[OnViewParameter::Fourth]->getValue();
auto x0set = onViewParameters[OnViewParameter::First]->isSet;
auto y0set = onViewParameters[OnViewParameter::Second]->isSet;
auto p3set = onViewParameters[OnViewParameter::Third]->isSet;
auto p4set = onViewParameters[OnViewParameter::Fourth]->isSet;
using namespace Sketcher;
auto constraintToOrigin = [&]() {
ConstraintToAttachment(GeoElementId(firstCurve, PointPos::start),
GeoElementId::RtPnt,
x0,
obj);
};
auto constraintx0 = [&]() {
ConstraintToAttachment(GeoElementId(firstCurve, PointPos::start),
GeoElementId::VAxis,
x0,
obj);
};
auto constrainty0 = [&]() {
ConstraintToAttachment(GeoElementId(firstCurve, PointPos::start),
GeoElementId::HAxis,
y0,
obj);
};
auto constraintp3DistanceX = [&]() {
if (fabs(p3) < Precision::Confusion()) {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('Vertical',%d)) ",
firstCurve);
}
else {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('DistanceX',%d,%d,%d,%d,%f)) ",
firstCurve,
1,
firstCurve,
2,
fabs(p3));
}
};
auto constraintp3length = [&]() {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('Distance',%d,%f)) ",
firstCurve,
fabs(p3));
};
auto constraintp3x = [&]() {
ConstraintToAttachment(GeoElementId(firstCurve, PointPos::end),
GeoElementId::VAxis,
p3,
obj);
};
auto constraintp4DistanceY = [&]() {
if (fabs(p4) < Precision::Confusion()) {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('Horizontal',%d)) ",
firstCurve);
}
else {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('DistanceY',%d,%d,%d,%d,%f)) ",
firstCurve,
1,
firstCurve,
2,
fabs(p4));
}
};
auto constraintp4angle = [&]() {
double angle = p4 / 180 * M_PI;
if (fabs(angle - M_PI) < Precision::Confusion()
|| fabs(angle + M_PI) < Precision::Confusion()
|| fabs(angle) < Precision::Confusion()) {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('Horizontal',%d)) ",
firstCurve);
}
else if (fabs(angle - M_PI / 2) < Precision::Confusion()
|| fabs(angle + M_PI / 2) < Precision::Confusion()) {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('Vertical',%d)) ",
firstCurve);
}
else {
Gui::cmdAppObjectArgs(obj,
"addConstraint(Sketcher.Constraint('Angle',%d,%d,%f)) ",
Sketcher::GeoEnum::HAxis,
firstCurve,
angle);
}
};
auto constraintp4y = [&]() {
ConstraintToAttachment(GeoElementId(firstCurve, PointPos::end),
GeoElementId::HAxis,
p4,
obj);
};
if (handler->AutoConstraints.empty()) { // No valid diagnosis. Every constraint can be added.
if (x0set && y0set && x0 == 0. && y0 == 0.) {
constraintToOrigin();
}
else {
if (x0set) {
constraintx0();
}
if (y0set) {
constrainty0();
}
}
if (handler->constructionMethod()
== DrawSketchHandlerLine::ConstructionMethod::OnePointLengthWidth) {
if (p3set) {
constraintp3DistanceX();
}
if (p4set) {
constraintp4DistanceY();
}
}
else if (handler->constructionMethod()
== DrawSketchHandlerLine::ConstructionMethod::OnePointLengthAngle) {
if (p3set) {
constraintp3length();
}
if (p4set) {
constraintp4angle();
}
}
else {
if (p3set) {
constraintp3x();
}
if (p4set) {
constraintp4y();
}
}
}
else { // Valid diagnosis. Must check which constraints may be added.
auto startpointinfo = handler->getPointInfo(GeoElementId(firstCurve, PointPos::start));
if (x0set && startpointinfo.isXDoF()) {
constraintx0();
handler->diagnoseWithAutoConstraints(); // ensure we have recalculated parameters after
// each constraint addition
startpointinfo = handler->getPointInfo(
GeoElementId(firstCurve, PointPos::start)); // get updated point position
}
if (y0set && startpointinfo.isYDoF()) {
constrainty0();
handler->diagnoseWithAutoConstraints(); // ensure we have recalculated parameters after
// each constraint addition
startpointinfo = handler->getPointInfo(
GeoElementId(firstCurve, PointPos::start)); // get updated point position
}
auto endpointinfo = handler->getPointInfo(GeoElementId(firstCurve, PointPos::end));
if (handler->constructionMethod()
== DrawSketchHandlerLine::ConstructionMethod::OnePointLengthWidth) {
int DoFs = startpointinfo.getDoFs();
DoFs += endpointinfo.getDoFs();
if (p3set && DoFs > 0) {
constraintp3DistanceX();
DoFs--;
}
if (p4set && DoFs > 0) {
constraintp4DistanceY();
}
}
else if (handler->constructionMethod()
== DrawSketchHandlerLine::ConstructionMethod::OnePointLengthAngle) {
int DoFs = startpointinfo.getDoFs();
DoFs += endpointinfo.getDoFs();
if (p3set && DoFs > 0) {
constraintp3length();
DoFs--;
}
if (p4set && DoFs > 0) {
constraintp4angle();
}
}
else {
if (p3set && endpointinfo.isXDoF()) {
constraintp3x();
handler->diagnoseWithAutoConstraints(); // ensure we have recalculated parameters
// after each constraint addition
startpointinfo = handler->getPointInfo(
GeoElementId(firstCurve, PointPos::start)); // get updated point position
endpointinfo = handler->getPointInfo(GeoElementId(firstCurve, PointPos::end));
}
if (p4set && endpointinfo.isYDoF()) {
constraintp4y();
}
}
}
}
} // namespace SketcherGui

View File

@@ -152,6 +152,10 @@
<file>icons/geometry/Sketcher_CreateHyperbolic_Arc_Constr.svg</file>
<file>icons/geometry/Sketcher_CreateLine.svg</file>
<file>icons/geometry/Sketcher_CreateLine_Constr.svg</file>
<file>icons/geometry/Sketcher_CreateLineAngleLength.svg</file>
<file>icons/geometry/Sketcher_CreateLineAngleLength_Constr.svg</file>
<file>icons/geometry/Sketcher_CreateLineLengthWidth.svg</file>
<file>icons/geometry/Sketcher_CreateLineLengthWidth_Constr.svg</file>
<file>icons/geometry/Sketcher_CreateOblong.svg</file>
<file>icons/geometry/Sketcher_CreateOblong_Constr.svg</file>
<file>icons/geometry/Sketcher_CreateOctagon.svg</file>
@@ -209,6 +213,7 @@
<file>icons/pointers/Sketcher_Pointer_Create_Ellipse.svg</file>
<file>icons/pointers/Sketcher_Pointer_Create_Fillet.svg</file>
<file>icons/pointers/Sketcher_Pointer_Create_Line.svg</file>
<file>icons/pointers/Sketcher_Pointer_Create_Line_Polar.svg</file>
<file>icons/pointers/Sketcher_Pointer_Create_Lineset.svg</file>
<file>icons/pointers/Sketcher_Pointer_Create_Point.svg</file>
<file>icons/pointers/Sketcher_Pointer_Extension.svg</file>

View File

@@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg2726"
version="1.1"
sodipodi:docname="Sketcher_CreateLineAngleLength.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview36"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="5.859375"
inkscape:cx="44.373333"
inkscape:cy="38.229333"
inkscape:window-width="1500"
inkscape:window-height="978"
inkscape:window-x="-6"
inkscape:window-y="-6"
inkscape:window-maximized="1"
inkscape:current-layer="svg2726" />
<defs
id="defs2728">
<radialGradient
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
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
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" />
<linearGradient
xlink:href="#linearGradient3836-0"
id="linearGradient3801-1"
gradientUnits="userSpaceOnUse"
x1="-18"
y1="18"
x2="-22"
y2="5" />
<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
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
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>
</defs>
<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: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>
<path
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 15.908118,53.33451 11.665477,49.091871 54.091883,6.6654658 58.334523,10.908105 Z"
id="path3061" />
<path
style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 14.002003,49.583771 54.583793,9.0019854"
id="path3063" />
<g
transform="translate(0.00573332,-0.00545933)"
id="g3827-1-3">
<g
transform="translate(31.322131,40.570289)"
id="g3797-9-5">
<path
style="fill:none;stroke:#280000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
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
style="fill:url(#linearGradient3801-1-3);fill-opacity:1;stroke:#ef2929;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
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
id="layer1-1"
transform="matrix(0.65003235,0,0,0.65003235,6.8406033,-0.87820731)">
<g
id="g3894"
transform="rotate(-45,34.506097,38.050253)">
<path
id="path3034"
d="M 17,27 V 19 L -4,32 17,45 v -8 h 40 v 8 L 78,32 57,19 v 8 z"
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
<path
id="path3034-3"
d="M 15,29 V 22.6 L -0.2,32 15,41.4 V 35 h 44 v 6.4 L 74.2,32 59,22.6 V 29 Z"
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
<g
id="layer1"
transform="matrix(0.56393666,-0.24012064,0.24012064,0.56393666,14.891594,37.412395)">
<path
style="fill:none;stroke:#280000;stroke-width:6.51681;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10.8;stroke-opacity:1"
id="path3827"
d="m 62.557446,20.443367 a 29.325663,29.325663 0 0 1 -0.632945,23.23123"
transform="matrix(1.2275938,0,0,1.2275937,-37.365562,-7.803863)" />
<path
style="fill:none;stroke:#280000;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 58,8 6,31 58,56"
id="path3021" />
<path
style="fill:none;stroke:#cc0000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 58,8 6,31 58,56"
id="path3021-3" />
<path
style="fill:none;stroke:#cc0000;stroke-width:3.25841;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10.8;stroke-opacity:1"
id="path3827-7"
d="m 62.557446,20.443367 a 29.325663,29.325663 0 0 1 -0.632945,23.23123"
transform="matrix(1.2275938,0,0,1.2275937,-37.365562,-7.803863)" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 58,7 6,30 58,55"
id="path3021-3-6" />
<path
style="fill:none;stroke:#ef2929;stroke-width:1.6292;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10.8;stroke-opacity:1"
id="path3827-7-5"
d="M 62.315568,19.856601 A 29.325663,29.325663 0 0 1 62.18947,43.08705"
transform="matrix(1.2275938,0,0,1.2275937,-38.312148,-7.6702077)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.3 KiB

View File

@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg2726"
version="1.1"
sodipodi:docname="Sketcher_CreateLineAngleLength_Constr.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview36"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="8.2864076"
inkscape:cx="21.299942"
inkscape:cy="30.290569"
inkscape:window-width="1500"
inkscape:window-height="978"
inkscape:window-x="-6"
inkscape:window-y="-6"
inkscape:window-maximized="1"
inkscape:current-layer="svg2726" />
<defs
id="defs2728">
<radialGradient
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
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
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" />
<linearGradient
xlink:href="#linearGradient3836-0"
id="linearGradient3801-1"
gradientUnits="userSpaceOnUse"
x1="-18"
y1="18"
x2="-22"
y2="5" />
<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
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
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="linearGradient896"
gradientUnits="userSpaceOnUse"
x1="-18"
y1="18"
x2="-22"
y2="5" />
</defs>
<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: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-1"
transform="matrix(0.65003235,0,0,0.65003235,6.2372055,-0.75752775)">
<g
id="g3894"
transform="rotate(-45,34.506097,38.050253)">
<path
id="path3034"
d="M 17,27 V 19 L -4,32 17,45 v -8 h 40 v 8 L 78,32 57,19 v 8 z"
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" />
<path
id="path3034-3"
d="M 15,29 V 22.6 L -0.2,32 15,41.4 V 35 h 44 v 6.4 L 74.2,32 59,22.6 V 29 Z"
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
</g>
</g>
<g
id="layer1"
transform="matrix(0.56393666,-0.24012064,0.24012064,0.56393666,14.891594,37.412395)">
<path
style="fill:none;stroke:#280000;stroke-width:6.51681;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10.8;stroke-opacity:1"
id="path3827"
d="m 62.557446,20.443367 a 29.325663,29.325663 0 0 1 -0.632945,23.23123"
transform="matrix(1.2275938,0,0,1.2275937,-37.365562,-7.803863)" />
<path
style="fill:none;stroke:#280000;stroke-width:8;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 58,8 6,31 58,56"
id="path3021" />
<path
style="fill:none;stroke:#cc0000;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 58,8 6,31 58,56"
id="path3021-3" />
<path
style="fill:none;stroke:#cc0000;stroke-width:3.25841;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10.8;stroke-opacity:1"
id="path3827-7"
d="m 62.557446,20.443367 a 29.325663,29.325663 0 0 1 -0.632945,23.23123"
transform="matrix(1.2275938,0,0,1.2275937,-37.365562,-7.803863)" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
d="M 58,7 6,30 58,55"
id="path3021-3-6" />
<path
style="fill:none;stroke:#ef2929;stroke-width:1.6292;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:10.8;stroke-opacity:1"
id="path3827-7-5"
d="M 62.315568,19.856601 A 29.325663,29.325663 0 0 1 62.18947,43.08705"
transform="matrix(1.2275938,0,0,1.2275937,-38.312148,-7.6702077)" />
</g>
<path
style="fill:#3465a4;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 15.787438,54.29995 11.544797,50.057311 53.971203,7.6309058 58.213843,11.873545 Z"
id="path3061-2" />
<path
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.881323,50.549211 54.463113,9.9674254"
id="path3063-8" />
<g
transform="translate(-0.11494668,0.95998067)"
id="g3827-1-3-5">
<g
transform="translate(31.322131,40.570289)"
id="g3797-9-5-6">
<path
style="fill:none;stroke:#280000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4250-71-6-3"
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
style="fill:url(#linearGradient896);fill-opacity:1;stroke:#ef2929;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4250-7-3-2-9"
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>
</svg>

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg2726"
version="1.1"
sodipodi:docname="Sketcher_CreateLineAngleWidth.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview36"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="2.0716019"
inkscape:cx="-103.54306"
inkscape:cy="-24.61863"
inkscape:window-width="1500"
inkscape:window-height="978"
inkscape:window-x="-6"
inkscape:window-y="-6"
inkscape:window-maximized="1"
inkscape:current-layer="svg2726" />
<defs
id="defs2728">
<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="perspective1481" />
<radialGradient
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
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
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" />
<linearGradient
xlink:href="#linearGradient3836-0"
id="linearGradient3801-1"
gradientUnits="userSpaceOnUse"
x1="-18"
y1="18"
x2="-22"
y2="5" />
<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
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
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>
</defs>
<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: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>
<path
style="fill:#d3d7cf;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 15.481447,52.566513 11.238806,48.323874 53.665212,5.8974661 57.907852,10.140108 Z"
id="path3061" />
<path
style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.746004,48.645108 54.327794,8.0633191"
id="path3063" />
<g
transform="translate(0.00573332,-0.00545933)"
id="g3827-1-3">
<g
transform="translate(31.322131,40.570289)"
id="g3797-9-5">
<path
style="fill:none;stroke:#280000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
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
style="fill:url(#linearGradient3801-1-3);fill-opacity:1;stroke:#ef2929;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
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
id="layer1"
transform="matrix(0.62854902,0,0,0.62854902,24.764235,32.463215)">
<path
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
d="m 3,17 h 8 V 29 H 53 V 17 h 8 V 49 H 53 V 37 H 11 V 49 H 3 Z"
id="path3018" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5,19 H 9 V 31 H 55 V 19 h 4 V 47 H 55 V 35 H 9 V 47 H 5 Z"
id="path3018-3" />
</g>
<g
id="layer1-4"
transform="matrix(0,-0.62854902,0.62854902,0,-9.7341177,38.972236)">
<path
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
d="m 3,17 h 8 V 29 H 53 V 17 h 8 V 49 H 53 V 37 H 11 V 49 H 3 Z"
id="path3018-6" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5,19 H 9 V 31 H 55 V 19 h 4 V 47 H 55 V 35 H 9 V 47 H 5 Z"
id="path3018-3-9" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64px"
height="64px"
id="svg2726"
version="1.1"
sodipodi:docname="Sketcher_CreateLineAngleWidth_Constr.svg"
inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<sodipodi:namedview
id="namedview36"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
objecttolerance="10.0"
gridtolerance="10.0"
guidetolerance="10.0"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="8.2864076"
inkscape:cx="23.592853"
inkscape:cy="35.841829"
inkscape:window-width="1500"
inkscape:window-height="978"
inkscape:window-x="-6"
inkscape:window-y="-6"
inkscape:window-maximized="1"
inkscape:current-layer="svg2726" />
<defs
id="defs2728">
<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="perspective1481" />
<radialGradient
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
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
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" />
<linearGradient
xlink:href="#linearGradient3836-0"
id="linearGradient3801-1"
gradientUnits="userSpaceOnUse"
x1="-18"
y1="18"
x2="-22"
y2="5" />
<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
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
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>
</defs>
<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: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>
<path
style="fill:#3465a4;stroke:#0b1521;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
d="M 15.481447,52.566513 11.238806,48.323874 53.665212,5.8974661 57.907852,10.140108 Z"
id="path3061" />
<path
style="fill:none;stroke:#729fcf;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 13.746004,48.645108 54.327794,8.0633191"
id="path3063" />
<g
transform="translate(0.00573332,-0.00545933)"
id="g3827-1-3">
<g
transform="translate(31.322131,40.570289)"
id="g3797-9-5">
<path
style="fill:none;stroke:#280000;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
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
style="fill:url(#linearGradient3801-1-3);fill-opacity:1;stroke:#ef2929;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
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
id="layer1"
transform="matrix(0.62854902,0,0,0.62854902,24.764235,32.463215)">
<path
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
d="m 3,17 h 8 V 29 H 53 V 17 h 8 V 49 H 53 V 37 H 11 V 49 H 3 Z"
id="path3018" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5,19 H 9 V 31 H 55 V 19 h 4 V 47 H 55 V 35 H 9 V 47 H 5 Z"
id="path3018-3" />
</g>
<g
id="layer1-4"
transform="matrix(0,-0.62854902,0.62854902,0,-9.7341177,38.972236)">
<path
style="fill:#cc0000;stroke:#280000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
d="m 3,17 h 8 V 29 H 53 V 17 h 8 V 49 H 53 V 37 H 11 V 49 H 3 Z"
id="path3018-6" />
<path
style="fill:none;stroke:#ef2929;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 5,19 H 9 V 31 H 55 V 19 h 4 V 47 H 55 V 35 H 9 V 47 H 5 Z"
id="path3018-3-9" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -0,0 +1,65 @@
<?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"
version="1.1"
height="64"
width="64"
id="svg12">
<metadata
id="metadata12">
<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></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs16">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath837">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 26.270815,42.52313 c 0,0 0,0 -13.662742,0 7.430614,-7.430614 7.430614,-7.430614 7.430614,-7.430614 z"
id="path839" />
</clipPath>
</defs>
<line
style="fill:none;stroke:#cc0000;stroke-width:2"
id="line2"
y2="28"
x2="50"
y1="57"
x1="20" />
<circle
style="fill:none;stroke:#cc0000;stroke-width:2"
id="circle4"
r="5"
cy="57"
cx="20" />
<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="path9" />
</g>
<path
style="fill:#ef2929;stroke:#cc0000;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:2,2;stroke-opacity:1;stroke-dashoffset:0"
d="m 25.072329,57.192599 c 28.284271,0 28.859544,10e-7 28.859544,10e-7"
id="path840" />
<ellipse
style="fill:none;stroke:#cc0000;stroke-width:2"
id="circle4-6"
cy="46.406227"
cx="21.333052"
r="5" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB