Skip to content

Commit 7d15f94

Browse files
committed
Add skewed subtype for extrusion groups. Update the textwindow radio buttons and equation generation.
1 parent eedfc65 commit 7d15f94

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

src/group.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ void Group::Generate(IdList<Entity,hEntity> *entity,
500500
AddParam(param, h.param(1), gn.y);
501501
AddParam(param, h.param(2), gn.z);
502502
int ai, af;
503-
if(subtype == Subtype::ONE_SIDED) {
503+
if(subtype == Subtype::ONE_SIDED || subtype == Subtype::ONE_SKEWED) {
504504
ai = 0; af = 2;
505505
} else if(subtype == Subtype::TWO_SIDED) {
506506
ai = -1; af = 1;
@@ -830,10 +830,10 @@ void Group::GenerateEquations(IdList<Equation,hEquation> *l) {
830830
Minus(Expr::From(h.param(3))->Times(Expr::From(valB))), 6);
831831
}
832832
}
833-
} else if(type == Type::EXTRUDE) {
833+
} else if(type == Type::EXTRUDE && subtype != Subtype::ONE_SKEWED) {
834834
if(predef.entityB != Entity::FREE_IN_3D) {
835835
// The extrusion path is locked along a line, normal to the
836-
// specified workplane.
836+
// specified workplane. Don't constrain for skewed extrusions.
837837
Entity *w = SK.GetEntity(predef.entityB);
838838
ExprVector u = w->Normal()->NormalExprsU();
839839
ExprVector v = w->Normal()->NormalExprsV();

src/groupmesh.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void Group::GenerateShellAndMesh() {
248248
Vector translate = Vector::From(h.param(0), h.param(1), h.param(2));
249249

250250
Vector tbot, ttop;
251-
if(subtype == Subtype::ONE_SIDED) {
251+
if(subtype == Subtype::ONE_SIDED || subtype == Subtype::ONE_SKEWED) {
252252
tbot = Vector::From(0, 0, 0); ttop = translate.ScaledBy(2);
253253
} else {
254254
tbot = translate.ScaledBy(-1); ttop = translate.ScaledBy(1);

src/sketch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ class Group {
204204
//WORKPLANE_BY_FACE = 6004,
205205
// For extrudes, translates, and rotates
206206
ONE_SIDED = 7000,
207-
TWO_SIDED = 7001
207+
TWO_SIDED = 7001,
208+
ONE_SKEWED = 7004
208209
};
209210
Group::Subtype subtype;
210211

src/textscreens.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ void TextWindow::ScreenChangeGroupOption(int link, uint32_t v) {
228228
switch(link) {
229229
case 's': g->subtype = Group::Subtype::ONE_SIDED; break;
230230
case 'S': g->subtype = Group::Subtype::TWO_SIDED; break;
231+
case 'w': g->subtype = Group::Subtype::ONE_SKEWED; break;
231232

232233
case 'k': g->skipFirst = true; break;
233234
case 'K': g->skipFirst = false; break;
@@ -377,14 +378,30 @@ void TextWindow::ShowGroupInfo() {
377378
Printf(true, " %Ft%s%E", s);
378379

379380
bool one = (g->subtype == Group::Subtype::ONE_SIDED);
381+
bool two = (g->subtype == Group::Subtype::TWO_SIDED);
382+
bool skew = (g->subtype == Group::Subtype::ONE_SKEWED);
383+
384+
if (g->type == Group::Type::EXTRUDE) {
385+
Printf(false,
386+
"%Ba %f%Ls%Fd%s one-sided%E "
387+
"%f%LS%Fd%s two-sided%E "
388+
"%f%Lw%Fd%s skewed%E",
389+
&TextWindow::ScreenChangeGroupOption,
390+
one ? RADIO_TRUE : RADIO_FALSE,
391+
&TextWindow::ScreenChangeGroupOption,
392+
two ? RADIO_TRUE : RADIO_FALSE,
393+
&TextWindow::ScreenChangeGroupOption,
394+
skew ? RADIO_TRUE : RADIO_FALSE);
395+
} else {
380396
Printf(false,
381397
"%Ba %f%Ls%Fd%s one-sided%E "
382398
"%f%LS%Fd%s two-sided%E",
383399
&TextWindow::ScreenChangeGroupOption,
384400
one ? RADIO_TRUE : RADIO_FALSE,
385401
&TextWindow::ScreenChangeGroupOption,
386-
!one ? RADIO_TRUE : RADIO_FALSE);
387-
402+
two ? RADIO_TRUE : RADIO_FALSE);
403+
}
404+
388405
if(g->type == Group::Type::ROTATE || g->type == Group::Type::TRANSLATE) {
389406
if(g->subtype == Group::Subtype::ONE_SIDED) {
390407
bool skip = g->skipFirst;

0 commit comments

Comments
 (0)