SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

From Edit/Rotate Imported 90 to Mirror about X/Y (by cea)
Hi,

I found this Edit/Rotate Imported 90 command very useful. It is rotate about Z axis. I want to make a Mirror about X/Y axis command. Which Line I should change?

Regards,

Cean

case Command::ROTATE_90: {
SS.GW.GroupSelection();
Entity *e = NULL;
if(SS.GW.gs.n == 1 && SS.GW.gs.points == 1) {
e = SK.GetEntity(SS.GW.gs.point[0]);
} else if(SS.GW.gs.n == 1 && SS.GW.gs.entities == 1) {
e = SK.GetEntity(SS.GW.gs.entity[0]);
}
SS.GW.ClearSelection();

hGroup hg = e ? e->group : SS.GW.activeGroup;
Group *g = SK.GetGroup(hg);
if(g->type != Group::Type::LINKED) {
Error(_("To use this command, select a point or other "
"entity from an linked part, or make a link "
"group the active group."));
break;
}

SS.UndoRemember();
// Rotate by ninety degrees about the coordinate axis closest
// to the screen normal.
Vector norm = SS.GW.projRight.Cross(SS.GW.projUp);
norm = norm.ClosestOrtho();
norm = norm.WithMagnitude(1);
Quaternion qaa = Quaternion::From(norm, PI/2);

g->TransformImportedBy(Vector::From(0, 0, 0), qaa);

// and regenerate as necessary.
SS.MarkGroupDirty(hg);
break;
}
Tue Dec 22 2020, 17:28:24
(no subject) (by cean)
Tue Dec 22 2020, 17:30:31
(no subject) (by cean)
Tue Dec 22 2020, 23:08:52
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.