mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-22 00:14:31 +01:00
reuse point on arc for point on ellipse action
This commit is contained in:
parent
3de8d2ce3b
commit
42372db6bb
3 changed files with 8 additions and 14 deletions
|
|
@ -330,15 +330,14 @@ ParametricManager.prototype.symmetry = function(objs) {
|
|||
};
|
||||
|
||||
ParametricManager.prototype.pointOnArc = function(objs) {
|
||||
var points = fetch.generic(objs, ['TCAD.TWO.EndPoint'], 1);
|
||||
var arcs = fetch.generic(objs, ['TCAD.TWO.Arc', 'TCAD.TWO.Circle'], 1);
|
||||
this.add(new Constraints.PointOnArc(points[0], arcs[0]));
|
||||
};
|
||||
|
||||
ParametricManager.prototype.pointOnEllipse = function(objs) {
|
||||
const points = fetch.generic(objs, ['TCAD.TWO.EndPoint'], 1);
|
||||
const ellipses = fetch.generic(objs, ['TCAD.TWO.Ellipse', 'TCAD.TWO.EllipticalArc'], 1);
|
||||
this.add(new Constraints.PointOnEllipse(points[0], ellipses[0]));
|
||||
const arcs = fetch.generic(objs, ['TCAD.TWO.Arc', 'TCAD.TWO.Circle', 'TCAD.TWO.Ellipse', 'TCAD.TWO.EllipticalArc'], 1);
|
||||
const arc = arcs[0];
|
||||
if (arc._class == 'TCAD.TWO.Ellipse' || arc._class == 'TCAD.TWO.EllipticalArc') {
|
||||
this.add(new Constraints.PointOnEllipse(points[0], arc));
|
||||
} else {
|
||||
this.add(new Constraints.PointOnArc(points[0], arc));
|
||||
}
|
||||
};
|
||||
|
||||
ParametricManager.prototype.pointOnLine = function(objs) {
|
||||
|
|
|
|||
|
|
@ -227,14 +227,10 @@ function App2D() {
|
|||
app.viewer.parametricManager.pointOnLine(app.viewer.selected);
|
||||
});
|
||||
|
||||
this.registerAction('pointOnArc', "Point On Arc", function () {
|
||||
this.registerAction('pointOnArc', "Point On Arc / Ellipse", function () {
|
||||
app.viewer.parametricManager.pointOnArc(app.viewer.selected);
|
||||
});
|
||||
|
||||
this.registerAction('pointOnEllipse', "Point On Ellipse", function () {
|
||||
app.viewer.parametricManager.pointOnEllipse(app.viewer.selected);
|
||||
});
|
||||
|
||||
this.registerAction('pointInMiddle', "Point In the Middle", function () {
|
||||
app.viewer.parametricManager.pointInMiddle(app.viewer.selected);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@
|
|||
<button class="btn rbtn act-lockConstraint" ><i class="fa fa-lock"></i></button>
|
||||
<div style="height: 10px;"></div>
|
||||
<button class="btn rbtn act-addFillet" style="background-image: url(img/vec/fillet.svg);"></button>
|
||||
<button class="btn rbtn act-pointOnEllipse">EP</button>
|
||||
</div>
|
||||
<div id="viewer-container" style="background: black; overflow: hidden; height: 100%; position: relative">
|
||||
<div class="tool-hint" style="position: absolute; bottom: 5px; right: 5px;"></div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue