Add faces perpendicular and parallel constraints.
parent
00418824f9
commit
3fe6349563
|
@ -721,7 +721,11 @@ void Constraint::MenuConstrain(Command id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
case Command::PARALLEL:
|
case Command::PARALLEL:
|
||||||
if(gs.vectors == 2 && gs.n == 2) {
|
if(gs.faces == 2 && gs.n == 2) {
|
||||||
|
c.type = Type::PARALLEL;
|
||||||
|
c.entityA = gs.face[0];
|
||||||
|
c.entityB = gs.face[1];
|
||||||
|
} else if(gs.vectors == 2 && gs.n == 2) {
|
||||||
c.type = Type::PARALLEL;
|
c.type = Type::PARALLEL;
|
||||||
c.entityA = gs.vector[0];
|
c.entityA = gs.vector[0];
|
||||||
c.entityB = gs.vector[1];
|
c.entityB = gs.vector[1];
|
||||||
|
@ -765,6 +769,7 @@ void Constraint::MenuConstrain(Command id) {
|
||||||
} else {
|
} else {
|
||||||
Error(_("Bad selection for parallel / tangent constraint. This "
|
Error(_("Bad selection for parallel / tangent constraint. This "
|
||||||
"constraint can apply to:\n\n"
|
"constraint can apply to:\n\n"
|
||||||
|
" * two faces\n"
|
||||||
" * two line segments (parallel)\n"
|
" * two line segments (parallel)\n"
|
||||||
" * a line segment and a normal (parallel)\n"
|
" * a line segment and a normal (parallel)\n"
|
||||||
" * two normals (parallel)\n"
|
" * two normals (parallel)\n"
|
||||||
|
@ -776,13 +781,18 @@ void Constraint::MenuConstrain(Command id) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Command::PERPENDICULAR:
|
case Command::PERPENDICULAR:
|
||||||
if(gs.vectors == 2 && gs.n == 2) {
|
if(gs.faces == 2 && gs.n == 2) {
|
||||||
|
c.type = Type::PERPENDICULAR;
|
||||||
|
c.entityA = gs.face[0];
|
||||||
|
c.entityB = gs.face[1];
|
||||||
|
} else if(gs.vectors == 2 && gs.n == 2) {
|
||||||
c.type = Type::PERPENDICULAR;
|
c.type = Type::PERPENDICULAR;
|
||||||
c.entityA = gs.vector[0];
|
c.entityA = gs.vector[0];
|
||||||
c.entityB = gs.vector[1];
|
c.entityB = gs.vector[1];
|
||||||
} else {
|
} else {
|
||||||
Error(_("Bad selection for perpendicular constraint. This "
|
Error(_("Bad selection for perpendicular constraint. This "
|
||||||
"constraint can apply to:\n\n"
|
"constraint can apply to:\n\n"
|
||||||
|
" * two faces\n"
|
||||||
" * two line segments\n"
|
" * two line segments\n"
|
||||||
" * a line segment and a normal\n"
|
" * a line segment and a normal\n"
|
||||||
" * two normals\n"));
|
" * two normals\n"));
|
||||||
|
|
|
@ -26,6 +26,9 @@ bool EntityBase::HasVector() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprVector EntityBase::VectorGetExprsInWorkplane(hEntity wrkpl) const {
|
ExprVector EntityBase::VectorGetExprsInWorkplane(hEntity wrkpl) const {
|
||||||
|
if(IsFace()) {
|
||||||
|
return FaceGetNormalExprs();
|
||||||
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Type::LINE_SEGMENT:
|
case Type::LINE_SEGMENT:
|
||||||
return (SK.GetEntity(point[0])->PointGetExprsInWorkplane(wrkpl)).Minus(
|
return (SK.GetEntity(point[0])->PointGetExprsInWorkplane(wrkpl)).Minus(
|
||||||
|
@ -62,6 +65,9 @@ ExprVector EntityBase::VectorGetExprs() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector EntityBase::VectorGetNum() const {
|
Vector EntityBase::VectorGetNum() const {
|
||||||
|
if(IsFace()) {
|
||||||
|
return FaceGetNormalNum();
|
||||||
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Type::LINE_SEGMENT:
|
case Type::LINE_SEGMENT:
|
||||||
return (SK.GetEntity(point[0])->PointGetNum()).Minus(
|
return (SK.GetEntity(point[0])->PointGetNum()).Minus(
|
||||||
|
@ -79,6 +85,9 @@ Vector EntityBase::VectorGetNum() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector EntityBase::VectorGetRefPoint() const {
|
Vector EntityBase::VectorGetRefPoint() const {
|
||||||
|
if(IsFace()) {
|
||||||
|
return FaceGetPointNum();
|
||||||
|
}
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case Type::LINE_SEGMENT:
|
case Type::LINE_SEGMENT:
|
||||||
return ((SK.GetEntity(point[0])->PointGetNum()).Plus(
|
return ((SK.GetEntity(point[0])->PointGetNum()).Plus(
|
||||||
|
|
Loading…
Reference in New Issue