Allow creating n-dimensional arrays with translate and rotate groups.

Before this commit, a translate group based on another translate
group would always use the "union" boolean operation, which does not
work at all if one wants an array with a difference operation, and
results in degraded performance if one wants an array with
an assemble operation.
This commit is contained in:
EvilSpirit 2016-10-11 23:46:42 +07:00 committed by whitequark
parent 6658b1fa2b
commit 2ccf5954d4
6 changed files with 8332 additions and 0 deletions

View File

@ -7,6 +7,8 @@ Changelog
New sketch features:
* Extrude, lathe, translate and rotate groups can now use the "assembly"
boolean operation, to increase performance.
* Translate and rotate groups can create n-dimensional arrays using
the "difference" and "assembly" boolean operations.
New export/import features:
* Three.js: allow configuring projection for exported model, and initially

View File

@ -471,6 +471,9 @@ void Group::Generate(IdList<Entity,hEntity> *entity,
}
case Type::TRANSLATE: {
// inherit meshCombine from source group
Group *srcg = SK.GetGroup(opA);
meshCombine = srcg->meshCombine;
// The translation vector
AddParam(param, h.param(0), gp.x);
AddParam(param, h.param(1), gp.y);
@ -498,6 +501,9 @@ void Group::Generate(IdList<Entity,hEntity> *entity,
return;
}
case Type::ROTATE: {
// inherit meshCombine from source group
Group *srcg = SK.GetGroup(opA);
meshCombine = srcg->meshCombine;
// The center of rotation
AddParam(param, h.param(0), gc.x);
AddParam(param, h.param(1), gc.y);

View File

@ -54,6 +54,7 @@ set(testsuite_SOURCES
request/line_segment/test.cpp
request/ttf_text/test.cpp
group/translate_asy/test.cpp
group/translate_nd/test.cpp
)
add_executable(solvespace_testsuite

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
#include "harness.h"
TEST_CASE(normal_roundtrip) {
CHECK_LOAD("normal.slvs");
CHECK_RENDER("normal.png");
CHECK_SAVE("normal.slvs");
}