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:
parent
6658b1fa2b
commit
2ccf5954d4
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
test/group/translate_nd/normal.png
Normal file
BIN
test/group/translate_nd/normal.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
8316
test/group/translate_nd/normal.slvs
Normal file
8316
test/group/translate_nd/normal.slvs
Normal file
File diff suppressed because it is too large
Load Diff
7
test/group/translate_nd/test.cpp
Normal file
7
test/group/translate_nd/test.cpp
Normal file
|
@ -0,0 +1,7 @@
|
|||
#include "harness.h"
|
||||
|
||||
TEST_CASE(normal_roundtrip) {
|
||||
CHECK_LOAD("normal.slvs");
|
||||
CHECK_RENDER("normal.png");
|
||||
CHECK_SAVE("normal.slvs");
|
||||
}
|
Loading…
Reference in New Issue
Block a user