Little changes, more pwls in a circle, and make "same orientation"

constraints work mod 180 degrees, so that it snaps to however the
workplane was drawn (more vertical vs. more horizontal).

[git-p4: depot-paths = "//depot/solvespace/": change = 1714]
solver
Jonathan Westhues 2008-05-10 18:57:47 -08:00
parent 10240cc1df
commit 4eed7693be
6 changed files with 16 additions and 5 deletions

View File

@ -564,7 +564,15 @@ void Constraint::Generate(IdList<Equation,hEquation> *l) {
AddEq(l, VectorsParallel(0, an, bn), 0);
AddEq(l, VectorsParallel(1, an, bn), 1);
AddEq(l, au.Dot(bv), 2);
Expr *d1 = au.Dot(bv);
Expr *d2 = au.Dot(bu);
// Allow either orientation for the coordinate system, depending
// on how it was drawn.
if(fabs(d1->Eval()) < fabs(d2->Eval())) {
AddEq(l, d1, 2);
} else {
AddEq(l, d2, 2);
}
break;
}

View File

@ -558,7 +558,7 @@ void Entity::DrawOrGetDistance(int order) {
Vector center = SS.GetEntity(point[0])->PointGetNum();
Vector u = q.RotationU(), v = q.RotationV();
int i, c = 20;
int i, c = 40;
Vector prev = u.ScaledBy(r).Plus(center);
for(i = 1; i <= c; i++) {
double phi = (2*PI*i)/c;

View File

@ -39,7 +39,8 @@ const GraphicsWindow::MenuEntry GraphicsWindow::menu[] = {
{ 1, "Dimensions in &Millimeters", MNU_UNITS_MM, 0, mView },
{ 0, "&Group", 0, 0, NULL },
{ 1, "New &Drawing Group\tShift+Ctrl+D", MNU_GROUP_DRAWING, 'D'|S|C,mGrp },
{ 1, "New &Drawing in 3d\tShift+Ctrl+D", MNU_GROUP_3D, 'D'|S|C, mGrp },
{ 1, "New Drawing in Workplane\tShift+Ctrl+W",MNU_GROUP_WRKPL, 'W'|S|C, mGrp },
{ 1, NULL, 0, NULL },
{ 1, "New Step and Repeat &Translating", 0, 0, NULL },
{ 1, "New Step and Repeat &Rotating", 0, 0, NULL },

View File

@ -43,6 +43,7 @@ class SEdgeList {
public:
SList<SEdge> l;
void InsertEdgeBreaking(SEdge *e);
bool AssemblePolygon(SPolygon *dest, SEdge *errorAt);
};

View File

@ -23,7 +23,7 @@ void Group::MenuGroup(int id) {
g.visible = true;
switch(id) {
case GraphicsWindow::MNU_GROUP_DRAWING:
case GraphicsWindow::MNU_GROUP_3D:
g.type = DRAWING;
g.name.strcpy("drawing");
break;

3
ui.h
View File

@ -109,7 +109,8 @@ public:
MNU_CUBIC,
MNU_CONSTRUCTION,
// Group
MNU_GROUP_DRAWING,
MNU_GROUP_3D,
MNU_GROUP_WRKPL,
MNU_GROUP_EXTRUDE,
// Constrain
MNU_DISTANCE_DIA,