Skip to content

Commit 457aec9

Browse files
committed
Clean up some comments. Also use a point for extusion side faces from the original line.
1 parent 2ee0cc6 commit 457aec9

File tree

4 files changed

+840
-782
lines changed

4 files changed

+840
-782
lines changed

src/group.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,10 +899,8 @@ void Group::MakeExtrusionLines(EntityList *el, hEntity in) {
899899
en.param[1] = h.param(1);
900900
en.param[2] = h.param(2);
901901
en.numPoint = a;
902-
// might use the original point, not the remapped one - but surface face uses TOP
903-
// using the original point might allow face dragging the sides unconstrained extrusions
904-
en.point[0] = Remap(ep->point[0], REMAP_TOP);
905-
// en.point[0] = ep->point[0];
902+
// we need a point somewhere on the face. Use one from the original line.
903+
en.point[0] = ep->point[0];
906904
en.numNormal = Quaternion::From(0, ab.x, ab.y, ab.z);
907905

908906
en.group = h;
@@ -1188,6 +1186,7 @@ void Group::CopyEntity(EntityList *el,
11881186
}
11891187
en.numPoint = (ep->actPoint).ScaledBy(scale);
11901188
en.numNormal = (ep->actNormal).ScaledBy(scale);
1189+
// the new face needs an associated point
11911190
en.point[0] = Remap(ep->point[0], remap);
11921191
break;
11931192

src/mouse.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,17 @@ void GraphicsWindow::StartDraggingByEntity(hEntity he) {
6565
AddPointToDraggedList(e->point[i]);
6666
}
6767
} else if(e->type == Entity::Type::FACE_NORMAL_PT
68-
|| e->type == Entity::Type::FACE_N_TRANS // translate groups work fine
69-
// || e->type == Entity::Type::FACE_N_ROT_AA // rotate groups are unstable dragging
68+
|| e->type == Entity::Type::FACE_N_TRANS // this is for translate groups
69+
70+
// rotate groups are currently unstable dragging
71+
// || e->type == Entity::Type::FACE_N_ROT_AA
7072

71-
// || e->type == Entity::Type::FACE_ROT_NORMAL_PT ) { // needed for helix and revolve
7273
// Revolve is unstable because the point is on axis. Helix drags in axial direction for same reason
74+
// || e->type == Entity::Type::FACE_ROT_NORMAL_PT ) { // needed for helix and revolve
7375

74-
|| e->type == Entity::Type::FACE_N_ROT_TRANS) { // needed for linked objects
75-
// Linking fails with old files because faces did not set point[0] prior to version 3.2
76+
|| e->type == Entity::Type::FACE_N_ROT_TRANS) { // needed for linked objects
77+
// Files save prior to v3.2 didn't specify point[0]
78+
// so check existence before using it.
7679
if(SK.entity.FindByIdNoOops(e->point[0]))
7780
{
7881
AddPointToDraggedList(e->point[0]);

test/group/translate_asy/normal.slvs

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,14 @@ Group.remap={
259259
127 8003002b 1000
260260
128 8003002c 1000
261261
129 8003002d 1000
262+
130 00040001 0
263+
131 00050001 0
264+
132 00060001 0
265+
133 00070001 0
266+
134 00040001 1000
267+
135 00050001 1000
268+
136 00060001 1000
269+
137 00070001 1000
262270
}
263271
AddGroup
264272

@@ -721,7 +729,7 @@ AddEntity
721729
Entity.h.v=80030007
722730
Entity.type=5001
723731
Entity.construction=0
724-
Entity.point[0].v=80030005
732+
Entity.point[0].v=00040001
725733
Entity.actPoint.x=10.00000000000000000000
726734
Entity.actPoint.y=-5.00000000000000000000
727735
Entity.actNormal.vx=-1.00000000000000000000
@@ -797,7 +805,7 @@ AddEntity
797805
Entity.h.v=80030010
798806
Entity.type=5001
799807
Entity.construction=0
800-
Entity.point[0].v=8003000e
808+
Entity.point[0].v=00050001
801809
Entity.actPoint.x=-5.00000000000000000000
802810
Entity.actPoint.y=-5.00000000000000000000
803811
Entity.actNormal.vy=1.00000000000000000000
@@ -873,7 +881,7 @@ AddEntity
873881
Entity.h.v=80030019
874882
Entity.type=5001
875883
Entity.construction=0
876-
Entity.point[0].v=80030017
884+
Entity.point[0].v=00060001
877885
Entity.actPoint.x=-5.00000000000000000000
878886
Entity.actPoint.y=5.00000000000000000000
879887
Entity.actNormal.vx=1.00000000000000000000
@@ -949,7 +957,7 @@ AddEntity
949957
Entity.h.v=80030022
950958
Entity.type=5001
951959
Entity.construction=0
952-
Entity.point[0].v=80030020
960+
Entity.point[0].v=00070001
953961
Entity.actPoint.x=10.00000000000000000000
954962
Entity.actPoint.y=5.00000000000000000000
955963
Entity.actNormal.vy=-1.00000000000000000000
@@ -1079,7 +1087,7 @@ AddEntity
10791087
Entity.h.v=80040007
10801088
Entity.type=5003
10811089
Entity.construction=0
1082-
Entity.point[0].v=80040005
1090+
Entity.point[0].v=80040082
10831091
Entity.actPoint.x=10.00000000000000000000
10841092
Entity.actPoint.y=-5.00000000000000000000
10851093
Entity.actNormal.vx=-1.00000000000000000000
@@ -1155,7 +1163,7 @@ AddEntity
11551163
Entity.h.v=80040010
11561164
Entity.type=5003
11571165
Entity.construction=0
1158-
Entity.point[0].v=8004000e
1166+
Entity.point[0].v=80040083
11591167
Entity.actPoint.x=-5.00000000000000000000
11601168
Entity.actPoint.y=-5.00000000000000000000
11611169
Entity.actNormal.vy=1.00000000000000000000
@@ -1231,7 +1239,7 @@ AddEntity
12311239
Entity.h.v=80040019
12321240
Entity.type=5003
12331241
Entity.construction=0
1234-
Entity.point[0].v=80040017
1242+
Entity.point[0].v=80040084
12351243
Entity.actPoint.x=-5.00000000000000000000
12361244
Entity.actPoint.y=5.00000000000000000000
12371245
Entity.actNormal.vx=1.00000000000000000000
@@ -1307,7 +1315,7 @@ AddEntity
13071315
Entity.h.v=80040022
13081316
Entity.type=5003
13091317
Entity.construction=0
1310-
Entity.point[0].v=80040020
1318+
Entity.point[0].v=80040085
13111319
Entity.actPoint.x=10.00000000000000000000
13121320
Entity.actPoint.y=5.00000000000000000000
13131321
Entity.actNormal.vy=-1.00000000000000000000
@@ -1437,7 +1445,7 @@ AddEntity
14371445
Entity.h.v=8004005d
14381446
Entity.type=5003
14391447
Entity.construction=0
1440-
Entity.point[0].v=8004005b
1448+
Entity.point[0].v=80040086
14411449
Entity.actPoint.x=20.00000000000000000000
14421450
Entity.actPoint.z=-5.00000000000000000000
14431451
Entity.actNormal.vx=-1.00000000000000000000
@@ -1511,7 +1519,7 @@ AddEntity
15111519
Entity.h.v=80040066
15121520
Entity.type=5003
15131521
Entity.construction=0
1514-
Entity.point[0].v=80040064
1522+
Entity.point[0].v=80040087
15151523
Entity.actPoint.x=5.00000000000000000000
15161524
Entity.actPoint.z=-5.00000000000000000000
15171525
Entity.actNormal.vy=1.00000000000000000000
@@ -1587,7 +1595,7 @@ AddEntity
15871595
Entity.h.v=8004006f
15881596
Entity.type=5003
15891597
Entity.construction=0
1590-
Entity.point[0].v=8004006d
1598+
Entity.point[0].v=80040088
15911599
Entity.actPoint.x=5.00000000000000000000
15921600
Entity.actPoint.y=10.00000000000000000000
15931601
Entity.actPoint.z=-5.00000000000000000000
@@ -1666,7 +1674,7 @@ AddEntity
16661674
Entity.h.v=80040078
16671675
Entity.type=5003
16681676
Entity.construction=0
1669-
Entity.point[0].v=80040076
1677+
Entity.point[0].v=80040089
16701678
Entity.actPoint.x=20.00000000000000000000
16711679
Entity.actPoint.y=10.00000000000000000000
16721680
Entity.actPoint.z=-5.00000000000000000000

0 commit comments

Comments
 (0)