Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: solvespace/solvespace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e51fdf6fba2e
Choose a base ref
...
head repository: solvespace/solvespace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b55dac762044
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Apr 21, 2020

  1. 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.
    phkahler authored Apr 21, 2020
    Copy the full SHA
    b55dac7 View commit details
Showing with 2 additions and 13 deletions.
  1. +2 −13 src/group.cpp
15 changes: 2 additions & 13 deletions src/group.cpp
Original file line number Diff line number Diff line change
@@ -566,8 +566,6 @@ void Group::Generate(IdList<Entity,hEntity> *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,hEntity> *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,hEntity> *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,hEntity> *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,hEntity> *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,hEntity> *entity,
entity->Add(&en);
}
}
ai++;
}
return;
}