From b55dac762044bc06112ad4359e253982dd72e338 Mon Sep 17 00:00:00 2001 From: phkahler <14852918+phkahler@users.noreply.github.com> Date: Mon, 20 Apr 2020 21:24:33 -0400 Subject: [PATCH] Don't create extra copies of entities in Revolve and Helix groups. Might break some older files with those groups that depend on these extra entities. Fixes #549. --- src/group.cpp | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/group.cpp b/src/group.cpp index ad00efe..ac9ccf0 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -566,8 +566,6 @@ void Group::Generate(IdList *entity, AddParam(param, h.param(5), axis_dir.y); AddParam(param, h.param(6), axis_dir.z); - int ai = 1; - // Not using range-for here because we're changing the size of entity in the loop. for(i = 0; i < entity->n; i++) { Entity *e = &(entity->Get(i)); @@ -576,10 +574,7 @@ void Group::Generate(IdList *entity, e->CalculateNumerical(/*forExport=*/false); hEntity he = e->h; - - CopyEntity(entity, SK.GetEntity(predef.origin), 0, ai, NO_PARAM, NO_PARAM, - NO_PARAM, NO_PARAM, NO_PARAM, NO_PARAM, NO_PARAM, NO_PARAM, CopyAs::NUMERIC); - + // one copy for each end of the revolved surface for(a = 0; a < 2; a++) { //! @todo is this check redundant? Entity *e = &(entity->Get(i)); @@ -596,7 +591,6 @@ void Group::Generate(IdList *entity, // entity is not chiral, and dragging a revolve may break the arc by inverting it. // MakeLatheCircles(entity, param, he, axis_pos, axis_dir, ai); MakeLatheSurfacesSelectable(entity, he, axis_dir); - ai++; } return; @@ -618,8 +612,6 @@ void Group::Generate(IdList *entity, // distance to translate along the rotation axis AddParam(param, h.param(7), 20); - int ai = 1; - // Not using range-for here because we're changing the size of entity in the loop. for(i = 0; i < entity->n; i++) { Entity *e = &(entity->Get(i)); @@ -628,9 +620,7 @@ void Group::Generate(IdList *entity, e->CalculateNumerical(/*forExport=*/false); - CopyEntity(entity, SK.GetEntity(predef.origin), 0, ai, NO_PARAM, NO_PARAM, - NO_PARAM, NO_PARAM, NO_PARAM, NO_PARAM, NO_PARAM, NO_PARAM, CopyAs::NUMERIC); - + // one copy for each end of the helix for(a = 0; a < 2; a++) { Entity *e = &(entity->Get(i)); e->CalculateNumerical(false); @@ -658,7 +648,6 @@ void Group::Generate(IdList *entity, entity->Add(&en); } } - ai++; } return; }