mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-15 02:37:51 -06:00
Ported some ModelObject methods from Perl to C++.
Added some utility functions to TriangleMesh, thanks to @alexrj Some porting to C++ based on work by @alexrj.
This commit is contained in:
parent
777023c7a8
commit
31085fb1d7
7 changed files with 191 additions and 81 deletions
|
@ -125,6 +125,9 @@ public:
|
|||
bool needed_repair() const;
|
||||
void cut(coordf_t z, Model* model) const;
|
||||
void split(ModelObjectPtrs* new_objects);
|
||||
|
||||
// Print object statistics to console.
|
||||
void print_info() const;
|
||||
|
||||
private:
|
||||
ModelObject(Model *model) : m_model(model), m_bounding_box_valid(false), layer_height_profile_valid(false) {}
|
||||
|
@ -232,7 +235,10 @@ public:
|
|||
Model(const Model &other);
|
||||
Model& operator= (Model other);
|
||||
void swap(Model &other);
|
||||
~Model();
|
||||
~Model() { this->clear_objects(); this->clear_materials(); }
|
||||
|
||||
static Model read_from_file(const std::string &input_file, bool add_default_instances = true);
|
||||
|
||||
ModelObject* add_object();
|
||||
ModelObject* add_object(const char *name, const char *path, const TriangleMesh &mesh);
|
||||
ModelObject* add_object(const char *name, const char *path, TriangleMesh &&mesh);
|
||||
|
@ -259,6 +265,11 @@ public:
|
|||
void duplicate(size_t copies_num, coordf_t dist, const BoundingBoxf* bb = NULL);
|
||||
void duplicate_objects(size_t copies_num, coordf_t dist, const BoundingBoxf* bb = NULL);
|
||||
void duplicate_objects_grid(size_t x, size_t y, coordf_t dist);
|
||||
|
||||
bool looks_like_multipart_object() const;
|
||||
void convert_multipart_object();
|
||||
|
||||
void print_info() const { for (const ModelObject *o : this->objects) o->print_info(); }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue