mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-11 19:59:01 +08:00
Fixed a 64bit compatiblity in admesh, fixed a typo in TriangleMesh::swap()
Conflicts: xs/src/libslic3r/TriangleMesh.cpp
This commit is contained in:
parent
9ed127274e
commit
497b7fb6c4
@ -24,6 +24,7 @@
|
||||
#define __admesh_stl__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -33,11 +34,15 @@ extern "C" {
|
||||
#define STL_MIN(A,B) ((A)<(B)? (A):(B))
|
||||
#define ABS(X) ((X) < 0 ? -(X) : (X))
|
||||
|
||||
// Size of the binary STL header, free form.
|
||||
#define LABEL_SIZE 80
|
||||
// Binary STL, length of the "number of faces" counter.
|
||||
#define NUM_FACET_SIZE 4
|
||||
// Binary STL, sizeof header + number of faces.
|
||||
#define HEADER_SIZE 84
|
||||
#define STL_MIN_FILE_SIZE 284
|
||||
#define ASCII_LINES_PER_FACET 7
|
||||
// Comparing an edge by memcmp, 2x3x4 bytes = 24
|
||||
#define SIZEOF_EDGE_SORT 24
|
||||
|
||||
typedef struct {
|
||||
@ -70,14 +75,17 @@ typedef struct {
|
||||
} stl_edge;
|
||||
|
||||
typedef struct stl_hash_edge {
|
||||
unsigned key[6];
|
||||
// Key of a hash edge: 2x binary copy of a floating point vertex.
|
||||
uint32_t key[6];
|
||||
int facet_number;
|
||||
int which_edge;
|
||||
struct stl_hash_edge *next;
|
||||
} stl_hash_edge;
|
||||
|
||||
typedef struct {
|
||||
// Index of a neighbor facet.
|
||||
int neighbor[3];
|
||||
// Index of an opposite vertex at the neighbor face.
|
||||
char which_vertex_not[3];
|
||||
} stl_neighbors;
|
||||
|
||||
|
@ -55,10 +55,10 @@ TriangleMesh& TriangleMesh::operator= (TriangleMesh other)
|
||||
}
|
||||
|
||||
void
|
||||
TriangleMesh::swap(TriangleMesh &first, TriangleMesh &second)
|
||||
TriangleMesh::swap(TriangleMesh &other)
|
||||
{
|
||||
std::swap(first.repaired, second.repaired);
|
||||
std::swap(first.stl, second.stl);
|
||||
std::swap(this->stl, other.stl);
|
||||
std::swap(this->repaired, other.repaired);
|
||||
}
|
||||
|
||||
TriangleMesh::~TriangleMesh() {
|
||||
|
@ -22,7 +22,7 @@ class TriangleMesh
|
||||
TriangleMesh();
|
||||
TriangleMesh(const TriangleMesh &other);
|
||||
TriangleMesh& operator= (TriangleMesh other);
|
||||
void swap(TriangleMesh &first, TriangleMesh &second);
|
||||
void swap(TriangleMesh &other);
|
||||
~TriangleMesh();
|
||||
void ReadSTLFile(const std::string &input_file);
|
||||
void write_ascii(const std::string &output_file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user