mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-02 19:44:00 -06:00
Attempt to solve conflict with a3bd1b5
by adding id to PrintObject and using that as a hash key.
This commit is contained in:
parent
9247f21ff8
commit
19d18bdd84
4 changed files with 19 additions and 7 deletions
|
@ -168,10 +168,11 @@ sub extrude_loop {
|
|||
if ($self->config->seal_position eq 'nearest') {
|
||||
$loop->split_at_vertex($last_pos->nearest_point(\@candidates));
|
||||
} elsif ($self->config->seal_position eq 'aligned') {
|
||||
if (defined $self->layer && defined $self->_seal_position->{$self->layer->object}) {
|
||||
$last_pos = $self->_seal_position->{$self->layer->object};
|
||||
my $object_id = $self->layer->object->id;
|
||||
if (defined $self->layer && defined $self->_seal_position->{$object_id}) {
|
||||
$last_pos = $self->_seal_position->{$object_id};
|
||||
}
|
||||
my $point = $self->_seal_position->{$self->layer->object} = $last_pos->nearest_point(\@candidates);
|
||||
my $point = $self->_seal_position->{$object_id} = $last_pos->nearest_point(\@candidates);
|
||||
$loop->split_at_vertex($point);
|
||||
}
|
||||
} elsif ($self->config->seal_position eq 'random') {
|
||||
|
|
|
@ -73,9 +73,10 @@ REGISTER_CLASS(PrintRegion, "Print::Region");
|
|||
#endif
|
||||
|
||||
|
||||
PrintObject::PrintObject(Print* print, ModelObject* model_object,
|
||||
PrintObject::PrintObject(Print* print, int id, ModelObject* model_object,
|
||||
const BoundingBoxf3 &modobj_bbox)
|
||||
: _print(print),
|
||||
_id(id),
|
||||
_model_object(model_object)
|
||||
{
|
||||
region_volumes.resize(this->_print->regions.size());
|
||||
|
@ -109,6 +110,12 @@ PrintObject::print()
|
|||
return this->_print;
|
||||
}
|
||||
|
||||
int
|
||||
PrintObject::id()
|
||||
{
|
||||
return this->_id;
|
||||
}
|
||||
|
||||
ModelObject*
|
||||
PrintObject::model_object()
|
||||
{
|
||||
|
@ -239,7 +246,8 @@ PrintObject*
|
|||
Print::add_object(ModelObject *model_object,
|
||||
const BoundingBoxf3 &modobj_bbox)
|
||||
{
|
||||
PrintObject *object = new PrintObject(this, model_object, modobj_bbox);
|
||||
PrintObject *object = new PrintObject(this,
|
||||
this->objects.size(), model_object, modobj_bbox);
|
||||
objects.push_back(object);
|
||||
return object;
|
||||
}
|
||||
|
@ -253,7 +261,7 @@ Print::set_new_object(size_t idx, ModelObject *model_object,
|
|||
PrintObjectPtrs::iterator old_it = this->objects.begin() + idx;
|
||||
delete *old_it;
|
||||
|
||||
PrintObject *object = new PrintObject(this, model_object, modobj_bbox);
|
||||
PrintObject *object = new PrintObject(this, idx, model_object, modobj_bbox);
|
||||
this->objects[idx] = object;
|
||||
return object;
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ class PrintObject
|
|||
|
||||
|
||||
Print* print();
|
||||
int id();
|
||||
ModelObject* model_object();
|
||||
|
||||
// adds region_id, too, if necessary
|
||||
|
@ -111,11 +112,12 @@ class PrintObject
|
|||
|
||||
private:
|
||||
Print* _print;
|
||||
int _id;
|
||||
ModelObject* _model_object;
|
||||
|
||||
// TODO: call model_object->get_bounding_box() instead of accepting
|
||||
// parameter
|
||||
PrintObject(Print* print, ModelObject* model_object,
|
||||
PrintObject(Print* print, int id, ModelObject* model_object,
|
||||
const BoundingBoxf3 &modobj_bbox);
|
||||
virtual ~PrintObject();
|
||||
};
|
||||
|
|
|
@ -66,6 +66,7 @@ _constant()
|
|||
%code%{ RETVAL = THIS->print()->regions.size(); %};
|
||||
|
||||
Ref<Print> print();
|
||||
int id();
|
||||
Ref<ModelObject> model_object();
|
||||
Ref<PrintObjectConfig> config()
|
||||
%code%{ RETVAL = &THIS->config; %};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue