C++ API¶
-
template<typename
Scalar>
class_Polygon - #include <Polygon.h>
: Polygon class
- Note
: we do not name the class as Polygon to avoid confusion with Polygon defined in windows.h
Subclassed by Cross< Scalar >
Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 2, 1>
Vector2
-
typedef Matrix<int, 3, 1>
Vector3i
Public Functions
-
_Polygon()
-
_Polygon(const _Polygon &poly)
-
~_Polygon()
-
void
setVertices(vector<Vector3> _vers)
-
size_t
push_back(Vector3 pt)
-
void
reverseVertices()
-
void
setPolyType(int _polyType)
-
void
setPolyType(PolygonType _polyType)
-
void
translatePolygon(Vector3 transVec)
-
void
translatePolygonTex(Vector2 transVec)
-
void
clear()
-
Vector3
pos(int index)
-
Vector2
tex(int index)
-
bool
at_boundary(int edge_index) const
-
bool
checkEquality(const _Polygon &poly) const
-
void
print() const
-
size_t
size() const
-
vector<Vector3>
getVertices() const
-
vector<Vector2>
getVerticesTex() const
-
int
getPolyType() const
-
Vector3
center() const
-
Vector3
normal() const
-
Vector3
computeFitedPlaneNormal() const
-
Scalar
area() const
-
Scalar
average_edge() const
-
Scalar
max_radius() const
-
void
triangulateNaive(vector<pTriangle> &tris) const
-
void
triangulate(vector<pTriangle> &tris) const
-
int
getPtVerID(Vector3 point) const
Private Members
-
PolygonType
polyType
-
template<typename
Scalar>
classAABBTree_Line -
Public Functions
-
bool
findIntersec(const Line<Scalar> &line, Vector2 &tex2D, Vector3 &pos3D) Search for an intersection between a given line and the lines defined in AABB tree.
- Return
true/false if an instersection is found
- Parameters
line:tex2D:pos3D:node:
Search for an intersection between a given line and the lines defined in AABB tree from a given node.
- Return
true/false if an instersection is found
- Parameters
line:tex2D:pos3D:node:
-
bool
checkLineBoxIntersec(const Line<Scalar> &line, const Box<Scalar> &box) Find if a 2D line is intersecting with a given box.
- Return
- Parameters
line:box:
Public Members
-
vector<shared_ptr<Node>>
nodes
-
vector<weak_ptr<Node>>
roots
-
bool
-
template<typename
Scalar>
classAugmentedVectorCreator: public TopoObject - #include <AugmentedVectorCreator.h>
: Create CrossMesh by Input the polygonal mesh and tiltAngle
Public Functions
-
~AugmentedVectorCreator()
-
void
createAugmentedVectors(Scalar tiltAngle, pCrossMesh crossMesh) Create crossMesh by setting alterative tiltAngle in polyMesh.
- Note
This is the main function
-
void
updateAugmentedVectors(Scalar tiltAngle, pCrossMesh crossMesh)
-
void
InitMeshTiltNormalsResolveConflicts(pCrossMesh crossMesh, Scalar tiltAngle) Distribute the sign of each tilt angle.
-
bool
UpdateMeshTiltRange(pCrossMesh crossMesh)
Public Static Functions
-
void
InitMeshTiltNormals(pCrossMesh crossMesh) Set initial tilt angle for each cross.
- Note
: the initial tilt angle is 0.
-
-
class
Bezier::AxisAlignedBoundingBox Public Functions
-
AxisAlignedBoundingBox(const ExtremePoints &xPoints)
-
float
minX() const
-
float
maxX() const
-
float
minY() const
-
float
maxY() const
-
float
width() const
-
float
height() const
-
float
area() const
-
Point &
operator[](size_t idx)
-
Point
operator[](size_t idx) const
Public Static Functions
-
constexpr size_t
size()
Private Members
-
Point
points[4]
-
-
template<typename
Scalar>
classBaseMeshCreator: public TopoObject - #include <BaseMeshCreator.h>
Mapping the 2D pattern into the 3D surface.
- Return
the base polygonal mesh
Public Types
-
typedef shared_ptr<PolyMesh_AABBTree<Scalar>>
pPolyMeshAABB
-
typedef weak_ptr<PolyMesh_AABBTree<Scalar>>
wpPolyMeshAABB
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 2, 1>
Vector2
-
typedef Matrix<Scalar, 4, 4>
Matrix4
Public Functions
-
~BaseMeshCreator()
-
void
computeBaseCrossMesh(Matrix<Scalar, 4, 4> textureMat, pPolyMesh &baseMesh2D, pCrossMesh &crossMesh, bool previewMode = false) : main function for mapping the 2D pattern into 3D surface
- Note
: it requires polyMesh with texture.
- Parameters
[in] polyMesh: input 3D guide surface[in] pattern2D: input 2D pattern[in] inverTextureMat: Map from 2D pattern space to surface texture space[out] baseMesh2D: output the base 2D mesh[out] baseMesh: output the base mesh
-
void
computeInternalCross(Matrix4 textureMat, pPolyMesh &baseMesh2D, pCrossMesh &crossMesh)
-
void
computeBoundaryCross(Matrix4 textureMat, pPolyMesh &baseMesh2D, pCrossMesh &crossMesh)
-
void
removeSmallCrosses(pCrossMesh crossMesh)
-
void
recomputeBoundary(pCrossMesh crossMesh)
-
void
removeDanglingCross(pCrossMesh crossMesh)
-
Vector2
getTextureCoord(Vector2 point, Matrix4 textureMat) : scale the 2D pattern position into UV space
Public Members
-
vector<pVertex>
pattern2D_vertices_on_polyMesh
-
tbb::concurrent_vector<pPolygon>
boundary_pattern2D
-
wpPolyMeshAABB
polyMesh
-
wpCrossMesh
pattern2D
-
const float
viewSize= 2.0
-
template<size_t
N>
classBezier::Bezier Public Functions
-
Bezier()
-
size_t
order() const
-
size_t
size() const
-
double
valueAt(float t, size_t axis) const
-
Point
valueAt(float t) const
-
Tangent
tangentAt(float t, bool normalize = true) const
-
Normal
normalAt(float t, bool normalize = true) const
-
void
translate(const Vec2 &distance)
-
void
translate(float dx, float dy)
-
ExtremeValues
derivativeZero(size_t intervals = BEZIER_DEFAULT_INTERVALS, double epsilon = BEZIER_FUZZY_EPSILON, size_t maxIterations = BEZIER_DEFAULT_MAX_ITERATIONS) const
-
ExtremePoints
extremePoints() const
-
AxisAlignedBoundingBox
aabb() const
-
AxisAlignedBoundingBox
aabb(const ExtremePoints &xPoints) const
-
TightBoundingBox
tbb() const
-
Point &
operator[](size_t idx)
-
Point
operator[](size_t idx) const
Public Static Attributes
-
const BinomialCoefficients<N>
binomialCoefficients= BinomialCoefficients<N>()
-
const PolynomialCoefficients<N>
polynomialCoefficients= PolynomialCoefficients<N>()
Private Functions
-
ExtremeValues
derivativeZero1() const
-
ExtremeValues
derivativeZero2() const
-
ExtremeValues
derivativeZero3() const
-
ExtremeValues
newtonRhapson(size_t intervals = BEZIER_DEFAULT_INTERVALS, double epsilon = BEZIER_FUZZY_EPSILON, size_t maxIterations = BEZIER_DEFAULT_MAX_ITERATIONS) const
Private Members
-
Point
mControlPoints[N+ 1]
-
-
template<size_t
N>
classBezier::BinomialCoefficients Public Functions
-
BinomialCoefficients()
-
const size_t
operator[](size_t idx) const
Public Static Functions
-
constexpr size_t
size()
Private Members
-
float
mCoefficients[size()]
-
-
template<typename
Scalar>
structBox Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
Public Functions
-
Box()
-
void
print()
-
void
computeCenter()
-
void
computeSize()
-
Scalar
computeQuadArea()
-
typedef Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
classContactGraph: public TopoObject Public Types
-
typedef shared_ptr<ContactGraphNode<Scalar>>
pContactGraphNode
-
typedef shared_ptr<ContactGraphEdge<Scalar>>
pContactGraphEdge
-
typedef weak_ptr<ContactGraphEdge<Scalar>>
wpContactGraphEdge
-
typedef weak_ptr<ContactGraphNode<Scalar>>
wpContactGraphNode
-
typedef Matrix<Scalar, 3, 1>
Vector3
Public Functions
Class constructor.
- Template Parameters
Scalar:
- Parameters
varList:
-
~ContactGraph() Class destructor.
- Template Parameters
Scalar:
-
bool
buildFromMeshes(const vector<pPolyMesh> &meshes, vector<bool> &atBoundary, Scalar eps = 0.002, bool convexhull = true) build the graph from a list of polygonal meshes
- Return
- Template Parameters
Scalar:
- Parameters
meshes:atBoundary:eps:convexhull: : merges faces which on a same plane by its convexhull
-
void
addNode(pContactGraphNode _node) - Template Parameters
Scalar:
- Parameters
_node:
-
void
addContact(pContactGraphNode _nodeA, pContactGraphNode _nodeB, pContactGraphEdge _edge) - Template Parameters
Scalar:
- Parameters
_nodeA:_nodeB:_edge:
-
void
mergeNode(pContactGraphNode _nodeA, pContactGraphNode _nodeB) merging nodeA and nodeB. they should move together.
- Template Parameters
Scalar:
- Parameters
_nodeA_nodeB:
-
void
finalize() Assign nodeID to the graph. Must be called after updating the graph.
- Template Parameters
Scalar:
-
void
getContactMesh(pPolyMesh &mesh) return the all contact polygons as a mesh
- Template Parameters
Scalar:
- Parameters
mesh:
Public Members
-
vector<pContactGraphNode>
nodes
-
vector<pContactGraphEdge>
edges
-
vector<pContactGraphEdge>
contact_edges
-
vector<std::pair<wpContactGraphNode, wpContactGraphNode>>
merged_nodes
-
vector<wpContactGraphNode>
dynamic_nodes
Private Functions
-
bool
clusterFacesofInputMeshes(Scalar eps) extract all polygonal faces from the meshes_input and cluster the faces which are on a same plane.
- Return
- Template Parameters
Scalar:
- Parameters
eps:
-
void
listPotentialContacts(vector<bool> &atBoundary) find all pairs of faces which are on a same plane. Their normals have to be on opposite directions
- Template Parameters
Scalar:
- Parameters
atBoundary:
-
void
computeContacts() Parallel compute contacts. Though faces in the ‘contact_pairs’ are on the same plane, checking whether they are overlap needs the 2D poly-poly intersection tool.
- Template Parameters
Scalar:
-
void
buildNodes(vector<bool> &atBoundary) add each part as a node into the graph
- Template Parameters
Scalar:
- Parameters
atBoundary:
-
void
buildEdges() for all pairs of potential contact faces, if their contact_graphedges is not empty, then we add this edge into the graph
- Template Parameters
Scalar:
-
void
computeConvexHullofEdgePolygons() simplified the contact between two nodes, only compute their convex-hull
- Template Parameters
Scalar:
Private Members
-
vector<pPolyMesh>
meshes_input
-
vector<polygonal_face>
contact_faces
-
vector<pairIJ>
contact_pairs
-
vector<pContactGraphEdge>
contact_graphedges
-
typedef shared_ptr<ContactGraphNode<Scalar>>
-
template<typename
Scalar>
classContactGraphEdge - #include <ContactGraphEdge.h>
: Stores which parts are contacted and the contact’s geometry
Public Functions
-
Vector3
getContactNormal(int partID) - Return
the contact normal starts from partID
-
int
num_points()
-
size_t
size()
-
Vector3
-
template<typename
Scalar>
classContactGraphNode - #include <ContactGraphNode.h>
Graph node records one part’s geometry and contacts with its neighbors.
Public Types
-
typedef shared_ptr<ContactGraphNode<Scalar>>
pContactGraphNode
-
typedef shared_ptr<ContactGraphEdge<Scalar>>
pContactGraphEdge
-
typedef weak_ptr<ContactGraphEdge<Scalar>>
wpContactGraphEdge
-
typedef weak_ptr<ContactGraphNode<Scalar>>
wpContactGraphNode
-
using
ContactNeighbor= pair<wpContactGraphNode, wpContactGraphEdge>
-
typedef Matrix<Scalar, 3, 1>
Vector3
Public Functions
-
float
height()
Public Members
-
bool
isBoundary
-
Vector3
centroid
-
Vector3
centerofmass
-
float
mass
-
vector<ContactNeighbor>
neighbors
-
int
staticID
-
int
dynamicID
-
typedef shared_ptr<ContactGraphNode<Scalar>>
-
template<typename
Scalar>
classConvexBlock: public TopoObject -
Public Functions
-
ConvexBlock(const ConvexBlock &part)
-
~ConvexBlock()
-
void
clear()
-
void
print()
-
void
computeCorners()
-
void
computeHyperPlanes()
-
void
computeFaces()
-
bool
checkGeometry()
-
bool
compute()
-
bool
at_boundary()
-
-
template<typename
Scalar>
classConvexHull2D Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
Public Functions
-
ConvexHull2D()
-
void
compute(const ListVector3 &in, ListVector3 &out)
-
void
compute(const ListVector3 &in, Vector3 normal, ListVector3 &out)
Private Functions
-
void
sortXY(ListVector3 &Array)
-
typedef Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
classConvexHull3D Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef std::vector<Matrix<int, 3, 1>>
ListVector3i
Public Functions
-
void
compute(ListVector3 &pointList, ListVector3 &ver, ListVector3i &tri)
-
void
compute(ListVector3 &pointList, Matrix<Scalar, Dynamic, Dynamic> &V, Matrix<int, Dynamic, Dynamic> &F)
-
typedef Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
classCross: public _Polygon<Scalar>, public TopoObject Public Types
Public Functions
-
~Cross()
-
void
print() const override
-
void
clear()
-
shared_ptr<OrientPoint<Scalar>>
ori(int index)
-
pCross
nei(int index)
-
void
initTiltNormals() Compute Initial Tilt Normal, the rotation angle is 0.
-
void
updateTiltNormalsRoot(float tiltAngle) : Initially update all oriPoints in this cross
1) alternatively update the sign by following the order as oriPoints
2) the sign of first orient point is positive
-
void
updateTiltNormals(float tiltAngle, const std::unordered_map<Cross<Scalar>*, bool> &crossVisited) : Update oriPoints in this cross
1) Apply breadth first search
2) The sign of some orient point could be changed in order to resolve conflict
3) In odd polygon, neighboring orient point could have same sign
: found the EdgeID (order in oriPoints) which correspond crossID is currCrossID
get the edgeID shared between two crosses or NOT_FOUND
- Return
EdgeID the local index of a polygon vertex
- Template Parameters
Scalar:
- Parameters
ncross: the 2nd cross
-
int
getEdgeIDOfGivenVertexID(int vertexID) get the local index of a vertex in a given polygon
fixme: edgeID is not a well chosen name. We should think of changing.
- Return
EdgeID the local index of a polygon vertex
- Template Parameters
Scalar:
- Parameters
vertexID:
Fills up a vector with the IDs of crosses shared between this cross and another one. A cross is shared if in contact with both other crosses.
- Return
The size this crossIDs vector or NOT_FOUND
- Template Parameters
Scalar:
- Parameters
ncross: the cross you want to checkshared_crossIDs: the vector of crossIDs
-
int
getPrevEdgeID(int edgeID) search for the previous local index of local index
fixme: edgeID is not a well chosen name. We should think of changing.
- Return
the previous local index
- Template Parameters
Scalar:
- Parameters
edgeID: the input local index
-
bool
checkNeighborAtBoundary(int nID)
Public Members
-
int
crossID
-
bool
atBoundary
-
vector<wpCross>
neighbors
-
vector<shared_ptr<OrientPoint<Scalar>>>
oriPoints
-
-
template<typename
Scalar>
classCrossMesh: private PolyMesh<Scalar> Public Types
Public Functions
-
CrossMesh(const CrossMesh &_cross)
-
~CrossMesh()
-
void
update()
-
void
createConnectivity()
-
void
print() const
-
bool
parse(const nlohmann::json &mesh_json)
-
nlohmann::json
dump() const
-
void
clear()
-
void
push_back(pCross _cross)
-
void
set_cross(size_t index, pCross _cross)
-
pCross
cross(size_t index)
-
void
erase(size_t index)
-
void
erase_nullptr()
-
size_t
size() const
-
const vector<wpCross> &
getVertexCrosses(int verID)
-
pPolyMesh
getPolyMesh() const
-
vector<int>
getBoundaryCrossIDs() const
-
void
updateCrossID()
-
Scalar
computeAverageCrossSize() const
Public Members
-
pPolyMesh
baseMesh2D
-
-
template<typename
Scalar>
classCrossMeshCreator: public TopoObject - #include <CrossMeshCreator.h>
CrossMesh = BaseMesh + AugmentedVector
Public Types
-
typedef shared_ptr<PolyMesh_AABBTree<Scalar>>
pPolyMeshAABB
-
typedef weak_ptr<PolyMesh_AABBTree<Scalar>>
wpPolyMeshAABB
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 2, 1>
Vector2
-
typedef Matrix<Scalar, 4, 4>
Matrix4
Public Functions
-
CrossMeshCreator(const CrossMeshCreator &_model)
-
~CrossMeshCreator()
-
void
clear()
-
bool
loadSurface(const char *objFileName) : load a .obj model from file
- Parameters
objFileName: .obj file pathtexturedModel: True if use the texture
-
bool
setReferenceSurface(pPolyMesh surface)
-
bool
setPatternMesh(pPolyMesh surface)
-
bool
setCrossMesh(pCrossMesh crossmesh)
-
bool
updatePatternMesh() : function to create the 2D tiling pattern by using the method in PatternCreator.cpp/.h
-
bool
createCrossMeshFromRSnPattern(bool previewMode, Matrix4 textureMat) : main function to create base CrossMesh
- Parameters
texturedModel: True if the geometry of cross mesh is unknown. False if the polymesh just need to be assigned the tilt anglepreviewMode: True if unnecessary operations are dismissed.
-
bool
createAugmentedVectors() : function to update the augmented vectors of each edge in cross mesh
-
bool
updateAugmentedVectors() : function to update the augmented vectors of each edge in cross mesh
-
bool
updateCrossMeshBoundary(const vector<int> &boundary_crossIDs) : function to update the boundary of the crossmesh
-
bool
computeAugmentedRange() : function to update the valid range of augmented vector
Private Functions
-
void
recomputeTexture()
-
typedef shared_ptr<PolyMesh_AABBTree<Scalar>>
-
struct
InterlockingSolver::EquilibriumData Public Members
-
stdvec_Vector3
force
-
stdvec_Vector3
torque
-
stdvec_Vector3
contact_points
-
vector<pairIJ>
partIJ
-
stdvec_Vector3
-
class
Bezier::ExtremePoints
-
struct
Bezier::ExtremeValue Public Functions
-
ExtremeValue(float t, size_t axis)
-
bool
fuzzyEquals(const ExtremeValue &other) const
Public Members
-
const float
t
-
const size_t
axis
-
-
class
Bezier::ExtremeValues Public Functions
-
bool
add(float t, size_t axis)
-
bool
add(const ExtremeValue &val)
-
size_t
size() const
-
ExtremeValue &
operator[](size_t idx)
-
ExtremeValue
operator[](size_t idx) const
Private Members
-
std::vector<ExtremeValue>
values
-
bool
-
template<typename
Scalar>
structHypEdge Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
structHypPlane Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
Public Functions
-
double
getD()
-
typedef Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
structHypVertex Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 3, 1>
-
struct
InputMeshNormalizeData Public Members
-
Vector3f
trans
-
float
scale
-
Vector3f
-
class
InputVar Subclassed by InputVarBool, InputVarFloat, InputVarInt, InputVarIntList, InputVarMatrix4d
Public Functions
-
InputVar()
-
~InputVar()
-
InputVar &
operator<<(string name)
-
void
operator=(string name)
-
void
clear_value()
Public Members
-
vector<string>
var_names
-
string
series_name
-
string
label
-
bool
visible
-
bool
update
-
varGUIType
var_gui_type
-
varValueType
var_value_type
-
std::function<void()>
func
-
-
class
InputVarBool: public InputVar Public Functions
-
InputVarBool(bool val)
-
~InputVarBool()
-
void
clear_value()
Public Members
-
int
value
-
int
default_value
-
-
class
InputVarFloat: public InputVar Public Functions
-
InputVarFloat(float val, Vector2f _bound = Vector2f(0, 0))
-
~InputVarFloat()
-
void
clear_value()
Public Members
-
float
value
-
float
default_value
-
Vector2f
bound
-
-
class
InputVarInt: public InputVar Public Functions
-
InputVarInt(int val, Vector2f _bound = Vector2f(0, 0))
-
~InputVarInt()
-
void
clear_value()
Public Members
-
int
value
-
int
default_value
-
Vector2f
bound
-
-
class
InputVarIntList: public InputVar Public Functions
-
InputVarIntList(vector<int> val)
Public Members
-
vector<int>
value
-
-
class
InputVarList Public Functions
-
InputVarList()
-
int
getInt(string name)
-
bool
getBool(string name)
-
float
getFloat(string name)
-
Eigen::Matrix4d
getMatrix4d(string name)
-
vector<int>
getIntList(string name)
-
vector<shared_ptr<InputVar>>
findSeries(string name)
-
InputVar *
find(string name)
-
InputVar &
add(int value, string name, string label)
-
InputVar &
add(int value, Vector2f bound, string name, string label)
-
InputVar &
add(float value, string name, string label)
-
InputVar &
add(float value, Vector2f bound, string name, string label)
-
InputVar &
add(bool value, string name, string label)
-
InputVar &
add(vector<int> value, string name, string label)
-
void
clear()
-
-
class
InputVarManager
-
class
InputVarMatrix4d: public InputVar Public Functions
-
InputVarMatrix4d(Eigen::Matrix4d val)
-
InputVarMatrix4d(vector<double> val)
-
vector<double>
to_vector_double()
Public Members
-
Eigen::Matrix4d
value
-
-
struct
InteractData Public Members
-
double
angle
-
double
x
-
double
y
-
double
scale
-
double
-
struct
InterlockingSolver::InterlockingData Public Members
-
stdvec_Vector3
traslation
-
stdvec_Vector3
rotation
-
stdvec_Vector3
center
-
stdvec_Vector3
-
template<typename
Scalar>
classInterlockingSolver: public TopoObject Subclassed by InterlockingSolver_Clp< Scalar >, InterlockingSolver_Ipopt< Scalar >
Public Types
-
typedef Matrix<double, 3, 1>
Vector3
-
typedef Matrix<double, 1, 2>
RowVector2
-
typedef Matrix<double, 1, 4>
RowVector4
-
typedef Eigen::Triplet<double>
EigenTriple
-
typedef weak_ptr<ContactGraphNode<Scalar>>
wpContactGraphNode
Public Functions
-
void
computeEquilibriumMatrix(Eigen::MatrixXd &mat, bool withFriction = false)
-
Scalar
computeEquilibriumMatrixConditonalNumber()
-
void
computeTranslationalInterlockingMatrix(vector<EigenTriple> &tri, Eigen::Vector2i &size)
-
void
computeRotationalInterlockingMatrix(vector<EigenTriple> &tri, Eigen::Vector2i &size)
-
void
computeRotationalInterlockingMatrixDense(Eigen::MatrixXd &mat)
-
void
computeTranslationalInterlockingMatrixDense(Eigen::MatrixXd &mat)
-
void
computeRotationalInterlockingMatrixSparse(EigenSpMat &mat)
-
void
appendAuxiliaryVariables(vector<EigenTriple> &tri, Eigen::Vector2i &size)
-
void
appendMergeConstraints(vector<EigenTriple> &tri, Eigen::Vector2i &size, bool isRotation)
Public Members
-
shared_ptr<ContactGraph<Scalar>>
graph
Protected Functions
-
void
get_force_from_norm_fric(Vector3 n, Vector3 u, Vector3 v, RowVector2 &fkx, RowVector2 &fky, RowVector2 &fkz)
-
void
get_force_from_norm_fric(Vector3 n, Vector3 u, Vector3 v, RowVector4 &fkx, RowVector4 &fky, RowVector4 &fkz)
-
void
get_moment_from_norm_fric_vertex(Vector3 n, Vector3 u, Vector3 v, Vector3 r, RowVector2 &mx, RowVector2 &my, RowVector2 &mz)
-
void
get_moment_from_norm_fric_vertex(Vector3 n, Vector3 u, Vector3 v, Vector3 r, RowVector4 &mx, RowVector4 &my, RowVector4 &mz)
-
void
get_A_j_k(int partID, int edgeID, Eigen::MatrixXd &Ajk, bool withFriction = false)
-
typedef Matrix<double, 3, 1>
-
template<typename
Scalar>
classInterlockingSolver_Clp: public InterlockingSolver<Scalar> Public Types
-
typedef shared_ptr<typename InterlockingSolver<Scalar>::InterlockingData>
pInterlockingData
-
typedef shared_ptr<ContactGraph<Scalar>>
pContactGraph
-
typedef shared_ptr<ContactGraphNode<Scalar>>
pContactGraphNode
-
typedef Matrix<Scalar, 3, 1>
Vector3
Public Functions
-
bool
isTranslationalInterlocking(pInterlockingData &data)
-
bool
isRotationalInterlocking(pInterlockingData &data)
-
bool
checkSpecialCase(pInterlockingData &data, vector<EigenTriple> copy_tris, bool rotationalInterlockingCheck, Eigen::Vector2i copy_size)
-
bool
solve(pInterlockingData &data, vector<EigenTriple> &tris, bool rotationalInterlockingCheck, int num_row, int num_col, int num_var)
-
bool
solveSimplex(pInterlockingData &data, bool rotationalInterlockingCheck, int num_row, int num_col, int num_var, const CoinPackedMatrix &matrix, const double *colLower, const double *colUpper, const double *objective, const double *rowLower, const double *rowUpper)
-
bool
solveBarrier(pInterlockingData &data, bool rotationalInterlockingCheck, int num_row, int num_col, int num_var, const CoinPackedMatrix &matrix, const double *colLower, const double *colUpper, const double *objective, const double *rowLower, const double *rowUpper)
-
void
unpackSolution(InterlockingSolver_Clp::pInterlockingData &data, bool rotationalInterlockingCheck, const double *solution, int num_var)
Public Members
-
CLP_SOLVER_TYPE
type
-
typedef shared_ptr<typename InterlockingSolver<Scalar>::InterlockingData>
-
template<typename
Scalar>
classInterlockingSolver_Ipopt: public InterlockingSolver<Scalar> Public Types
-
typedef shared_ptr<typename InterlockingSolver<Scalar>::InterlockingData>
pInterlockingData
-
typedef Eigen::Triplet<double>
EigenTriple
-
typedef shared_ptr<ContactGraph<Scalar>>
pContactGraph
-
typedef shared_ptr<ContactGraphNode<Scalar>>
pContactGraphNode
-
typedef Eigen::Matrix<double, 3, 1>
Vector3
Public Functions
-
bool
isTranslationalInterlocking(pInterlockingData &data)
-
bool
isRotationalInterlocking(pInterlockingData &data)
-
bool
checkSpecialCase(pInterlockingData &data, vector<EigenTriple> copy_tris, bool rotationalInterlockingCheck, Eigen::Vector2i copy_size)
-
bool
solve(pInterlockingData &data, vector<EigenTriple> &tris, bool rotationalInterlockingCheck, int num_row, int num_col, int num_var)
-
void
unpackSolution(InterlockingSolver_Ipopt::pInterlockingData &data, bool rotationalInterlockingCheck, const double *solution, int num_var)
-
typedef shared_ptr<typename InterlockingSolver<Scalar>::InterlockingData>
-
struct
IOData Public Functions
-
IOData()
Public Members
-
shared_ptr<InputVarList>
varList
-
shared_ptr<PolyMesh<double>>
reference_surface
-
shared_ptr<PolyMesh<double>>
pattern_mesh
-
shared_ptr<CrossMesh<double>>
cross_mesh
-
vector<int>
boundary_crossIDs
-
vector<int>
pickPartIDs
-
double
interactMatrix[16]
-
InteractData
interact_delta
-
InputMeshNormalizeData
normalizedData
-
-
class
IpoptProblem: public TNLP - #include <InterlockingSolver_Ipopt.h>
Interface between Ipopt NLP interface and TopoLite Interlocking Solver.
NLP provides an easy interface to Ipopt.
tris is equal to a sparse matrix A, which size is [num_row x num_col]
our variables are [x, t], a row vector.
x: (size: num_var) is the instant translational and rotational velocity.
t: (size: num_col - num_var) is the auxiliary variable.
The optimization is formulated as:
s.t. A.X + * >= T 0 =< x_i =< 1 x_i are real 0 <= <= 1max (\sum_{i = 0}^{num_var} t_i) + \lambda M
Ideally if the structure is interlocking, the objective value should be zero.
In practice, due to numerical error, we have to allow a small tolerance for the objective value.
Wang, Z. et al. (2019). ACM Transactions on Graphics, 38(6), 1–13. https://doi.org/10.1145/3355089.3356489
Wang, Z. (2019). Supplementary Material. ACM Transactions on Graphics, 38(6), 3–5.
Methods to block default compiler methods.
The compiler automatically generates the following three methods. Since the default compiler implementation is generally not what you want (for all but the most simple classes), we usually put the declarations of these methods in the private section and never implement them. This prevents the compiler from implementing an incorrect “default” behavior without us knowing. (See Scott Meyers book, “Effective C++”)
-
IpoptProblem(const IpoptProblem&)
-
IpoptProblem &
operator=(const IpoptProblem&)
Public Types
Public Functions
-
IpoptProblem() Default constructor
-
~IpoptProblem() override Default destructor
-
bool
get_nlp_info(Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, IndexStyleEnum &index_style) override Get infos about problem dimensions.
- Parameters
n: number of variablesm: number of constraints eq/ineqnnz_jac_g: non-zero elements in constaints Jacobiannnz_h_lag: non-zero elements in Lagrangian and Hessianindex_style: C or Fortran style
-
bool
initialize(EigenSpMat &mat) Set infos about problem dimensions. The following vars are set:
- Parameters
mat: initial B matrix elements before adding big M contribution to it
-
bool
get_bounds_info(Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u) override Get the problem bounds conditions.
- Parameters
n: number of variablesx_l: lower bounds for the variablesx_u: upper bounds for the variablesm: number of constraints eq/ineqg_l: lower bounds for the constraintsg_u: upper bounds for the constraints
-
void
set_vectors_dimensions()
-
void
append_bigm_variables(EigenSpMat &mat) Compute B = B_interlock + t0.
/ B00 … B1n | 1 \ B = | … … … | 1 | \ Bm1 … Bmn | 1 /
-
bool
set_bounds_info() Set the problem bounds conditions. The following vars are set.
-
bool
get_starting_point(Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda) override Get the starting point for solving the pb Cannot be used for our problem. If we know a starting point, it is not interlocking.
- Parameters
n: number of variablesinit_x:x:init_z:z_L:z_U:m:init_lambda:lambda:
-
bool
eval_f(Index n, const Number *x, bool new_x, Number &obj_value) override - Return
- Parameters
n: number of variablesx: variables valuesnew_x:obj_value: value of the objective function
-
bool
eval_grad_f(Index n, const Number *x, bool new_x, Number *grad_f) override Method to return the gradient of the objective.
- Return
- Parameters
n: number of variablesx: variables valuesnew_x:grad_f: gradient vector values
-
bool
eval_g(Index n, const Number *x, bool new_x, Index m, Number *g) override Method to return the constraint residuals Computes g = B * X.
- Return
- Parameters
n: number of variablesx: variables valuesnew_x:m: number of constraintsg: constraints residuals
-
bool
eval_jac_g(Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values) override Method to return: 1) The structure of the jacobian (if “values” is NULL) 2) The values of the jacobian (if “values” is not NULL)
-
bool
eval_h(Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values) override Method to return: 1) The structure of the hessian of the lagrangian (if “values” is NULL) 2) The values of the hessian of the lagrangian (if “values” is not NULL)
-
void
finalize_solution(SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) override This method is called when the algorithm is complete so the TNLP can store/write the solution
Public Members
-
Index
n_var Dimensions of the problem
-
Index
n_var_real
-
Index
n_constraints
-
Index
non_zero_jacobian_elements
-
Index
non_zero_hessian_elements
-
IndexStyleEnum
index_style
-
RVectorXd
x_l Bounds for variables x and constraints g (l:lower, u:upper)
-
RVectorXd
x_u
-
RVectorXd
g_l
-
RVectorXd
g_u
-
EigenSpMat
b_coeff Coefficients matrix
-
RVectorXd
x Objective value, x and x_solution vectors
-
RVectorXd
x_solution
-
Number
obj_value
-
Number
max_abs_t
-
Number
big_m big M
-
class
JsonIOReader Public Functions
-
bool
read()
-
bool
readParameter(const nlohmann::json ¶meter_json)
-
bool
readPatternMesh(const nlohmann::json &mesh_json)
-
bool
readReferenceMesh(const nlohmann::json &mesh_json)
-
bool
readCrossMesh(const nlohmann::json &mesh_json)
-
bool
-
class
JsonIOWriter Public Functions
-
void
write()
-
nlohmann::json
getParameterJson()
-
void
-
template<typename
Scalar>
structLine
-
struct
AABBTree_Line::Node
-
template<typename
Scalar>
structOrientPoint -
Public Functions
-
OrientPoint(const nlohmann::json &oript_json)
-
void
updateAngle(Scalar _angle) Update rotation_angle (always positive) + define normal
-
void
print()
-
nlohmann::json
dump()
-
void
parse(const nlohmann::json &oript_json)
-
-
template<typename
Scalar>
classPatternCreator: public TopoObject -
Public Functions
-
PatternCreator()
-
~PatternCreator()
-
void
create2DPattern(PatternType patternID, int patternRadius, pCrossMesh &out)
-
void
computeNeighbors(PatternType crosstype, pPolygon poly, vector<pPolygon> &out)
-
Matrix<Scalar, 3, 1>
ComputeTileTranslation(pPolygon neighbor, Vector3 tagtStaPt, Vector3 tagtEndPt)
-
void
CreatePolygon_Square(pPolygon &out, Scalar edgeLen, int polyType = POLY_SQUARE_THETA_45)
-
void
CreatePolygon_Hexagon(pPolygon &out, Scalar edgeLen, int polyType = POLY_HEXAGON_TYPE_0)
-
void
CreatePolygon_Rhombus(pPolygon &out, Scalar edgeLen, int polyType = POLY_RHOMBUS_THETA_0)
-
void
CreatePolygon_Pentagon_Cross(pPolygon &out, Scalar edgeLen, int polyType = POLY_PENTAGON_CROSS_TYPE_0)
-
void
CreatePolygon_Pentagon_Snow(pPolygon &out, Scalar edgeLen, int polyType = POLY_PENTAGON_SNOW_TYPE_0)
-
void
CreatePolygon_Pentagon_Mirror(pPolygon &out, Scalar edgeLen, int polyType = POLY_PENTAGON_MIRROR_TYPE_0)
-
vector<vector<double>>
PyCreateMesh_2DPattern(int patternID, int patternRadius)
-
-
template<typename
Scalar>
structPlane Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 3, 1>
-
struct
ContactGraph::plane_contact_compare Public Functions
-
bool
operator()(const polygonal_face &A, const polygonal_face &B) const
-
bool
-
template<typename
Scalar>
structPoint Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 3, 1>
-
struct
ContactGraph::polygonal_face Public Members
-
Matrix<Scalar, 3, 1>
nrm
-
double
D
-
int
partID
-
int
groupID
-
wpPolygon
polygon
-
double
eps
-
Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
classPolyMesh: public TopoObject Subclassed by CrossMesh< Scalar >, PolyMesh_AABBTree< Scalar >
Public Functions
-
PolyMesh(const PolyMesh &_mesh)
-
~PolyMesh()
-
void
clear()
-
void
update()
-
void
setPolyLists(vector<pPolygon> _polyList)
-
bool
parse(const nlohmann::json &mesh_json) : parse from json file
- Return
: whether read the json object successfully
- Parameters
mesh_json: json object of the mesh
-
bool
readOBJModel(const char *fileName, bool normalized) : Read OBJ File (from file)
- Parameters
fileName: filename of an input filenormalized: scale the mode into [-1, 1] x [-1, 1] x [-1, 1] box;
-
bool
readOBJModel(const vector<vector<double>> &V, const vector<vector<double>> &TC, const vector<vector<int>> &F, const vector<vector<int>> &FTC, bool normalized) : Read OBJ File (from matrix)
- Parameters
V: vertice’s position arraryTC: vertex texture coordinates arrayF: face index (tri or polygon)FTC: texture face index (tri or polygon)normalized: scale the mode into [-1, 1] x [-1, 1] x [-1, 1] box;
-
void
removeDuplicatedVertices(double eps = FLOAT_ERROR_LARGE)
-
void
mergeFaces(double eps = 1e-3)
-
void
computeVertexList()
-
void
computeTextureList()
-
void
translateMesh(Vector3 move)
-
void
scaleMesh(Vector3 scale)
-
void
print() const
-
vector<Vector3>
getVertices() const
-
void
writeOBJModel(const char *objFileName, bool triangulate = false) const
-
nlohmann::json
dump() const
-
void
convertToTriMesh(vector<pTriangle> &triList) const
-
Vector3
centroid() const
-
Scalar
volume() const
-
Vector3
lowestPt() const
-
size_t
size()
-
-
template<typename
Scalar>
classPolyMesh_AABBTree: public PolyMesh<Scalar> -
Public Functions
-
void
buildTexTree() build a texture tree
-
void
buildPosTree()
-
pPolygon
findTexPoint(VectorX pt) Search if a point represented by a Vector2d belongs to a given texture polygon. If the point is on a shared edge between polygons then, one of these polygons is returned.
- Return
a texture polygon or nullptr
- Parameters
ptis: a 2 dimension point
-
Vector3d
findMeshNearestPoint(Vector3 pt)
-
void
-
template<size_t
N>
classBezier::PolynomialCoefficients Public Functions
-
PolynomialCoefficients()
-
double
valueAt(size_t pos, float t) const
-
const PolynomialPair &
operator[](size_t idx) const
Public Static Functions
-
constexpr size_t
size()
Private Members
-
PolynomialPair
mPolynomialPairs[size()]
-
-
struct
Bezier::PolynomialPair Public Functions
-
double
valueAt(float t) const
Public Members
-
size_t
t= 0
-
size_t
one_minus_t= 0
-
double
-
template<typename
Scalar>
classPolyPolyBoolean: private TopoObject Public Functions
-
void
computePolygonsUnion(PolysVector3 &polys, PolysVector3 &polysUnion)
-
void
computePolygonsIntersection(const PolyVector3 &polyA, const PolyVector3 &polyB, PolyVector3 &polyIntsec)
-
void
computePolygonsIntersection(const PolyVector3 &polyA, const PolyVector3 &polyB, PolysVector3 &polyIntsec)
-
bool
check2DPolygonsIntersection(const PolyVector2 &polyA, const PolyVector2 &polyB, Scalar &area)
-
void
printPolygon(const PolyVector3 &poly)
-
void
cleanPath(PolyVector3 &polyIntsec)
-
void
computeFrame(const PolyVector3 &poly, Vector3 &xaxis, Vector3 &yaxis, Vector3 &origin)
-
Scalar
computeScale(const PolysVector3 &poly, Vector3 &xaxis, Vector3 &yaxis, Vector3 &origin)
-
Scalar
computeScale(const PolysVector2 &poly)
-
Vector3
computeNormal(const PolyVector3 &poly)
-
Vector3
computeCenter(const PolyVector3 &poly)
-
ClipperLib::Path
projectToNormalPlane(const PolyVector3 &poly, Vector3 xaxis, Vector3 yaxis, Vector3 origin, Scalar Scale)
-
PolyVector3
projectTo3D(const ClipperLib::Path &path, Vector3 xaxis, Vector3 yaxis, Vector3 origin, Scalar scale)
-
void
-
struct
PatternCreator::pVertex_compare Public Functions
-
bool
operator()(const Vector3 &A, const Vector3 &B) const
-
bool
-
struct
PolyMesh::sort_vertex
-
struct
PolyMesh::sort_vertex_compare Public Functions
-
bool
operator()(const sort_vertex &A, const sort_vertex &B) const
-
bool
-
template<typename
Scalar>
classStrucCreator: public TopoObject Public Types
-
typedef shared_ptr<ConvexBlock<Scalar>>
pConvexBlock
-
typedef Matrix<Scalar, 2, 1>
Vector2
Public Members
-
vector<pConvexBlock>
blocks
-
typedef shared_ptr<ConvexBlock<Scalar>>
-
class
Bezier::TightBoundingBox Public Functions
-
TightBoundingBox(const ExtremePoints &xPoints, const Vec2 &translation, double rotation)
-
float
minX() const
-
float
maxX() const
-
float
minY() const
-
float
maxY() const
-
float
area() const
-
float
width() const
-
float
height() const
-
Point &
operator[](size_t idx)
-
Point
operator[](size_t idx) const
Public Static Functions
-
constexpr size_t
size()
Private Members
-
Point
points[4]
-
-
class
TopoObject Subclassed by AugmentedVectorCreator< Scalar >, BaseMeshCreator< Scalar >, ContactGraph< Scalar >, ConvexBlock< Scalar >, Cross< Scalar >, CrossMeshCreator< Scalar >, InterlockingSolver< Scalar >, PatternCreator< Scalar >, PolyMesh< Scalar >, PolyPolyBoolean< Scalar >, StrucCreator< Scalar >
Public Functions
-
TopoObject()
-
TopoObject(const TopoObject &obj)
-
shared_ptr<InputVarList>
getVarList() const
-
bool
checkCoherency()
Private Members
-
shared_ptr<InputVarList>
varList
-
-
template<typename
Scalar>
structTriangle
-
class
Bezier::Vec2 Public Functions
-
Vec2()
-
Vec2(float x, float y)
-
Vec2(float x, float y, bool normalize)
-
Vec2(const Vec2 &other)
-
Vec2(const Vec2 &other, bool normalize)
-
void
set(float x, float y)
-
void
set(const Vec2 &other)
-
double
length() const
-
void
normalize()
-
void
translate(float dx, float dy)
-
void
translate(const Vec2 &distance)
-
float
angle() const
-
float
angleDeg() const
-
float
operator[](size_t axis) const
-
float &
operator[](size_t axis)
-
Vec2
operator-() const
-
Vec2
operator*(double scale) const
-
Vec2
operator/(double scale) const
-
bool
fuzzyEquals(const Vec2 &other) const
-
bool
isWithinZeroAndOne() const
Public Members
-
float
x
-
float
y
Public Static Attributes
-
constexpr size_t
size= 2
-
-
template<typename
Scalar>
classVPoint Public Types
-
typedef Matrix<Scalar, 3, 1>
Vector3
-
typedef Matrix<Scalar, 3, 1>
-
template<typename
Scalar>
classVTex Public Types
-
typedef Matrix<Scalar, 2, 1>
Vector2
-
typedef Matrix<Scalar, 2, 1>
-
class
XMLIO_backward Public Functions
-
void
XMLReader_GUISettings(pugi::xml_node &xml_root, IOData &data)
-
bool
XMLReader_ReferenceSurface(pugi::xml_node &xml_root, const std::string xmlFileName_path, IOData &data)
-
bool
XMLReader_CrossMesh(pugi::xml_node &xml_root, const std::string xmlFileName_path, IOData &data)
-
void
XMLReader_Boundary(pugi::xml_node &xml_root, IOData &data)
-
void
-
namespace
Bezier Typedefs
-
typedef Vec2
Point
-
typedef Vec2
Normal
-
typedef Vec2
Tangent
-
typedef AxisAlignedBoundingBox
AABB
-
typedef TightBoundingBox
TBB
-
typedef Vec2
-
namespace
Bezier::Math Functions
-
double
faculty(size_t n)
-
double
binomial(size_t n, size_t k)
-
bool
isWithinZeroAndOne(float x)
-
double
-
namespace
Eigen
-
namespace
Ipopt
-
namespace
std
-
namespace
filesystem
-
file
CMakeLists.txt Functions
-
add_subdirectory (CrossMesh) add_subdirectory(Interlocking) add_subdirectory(IO) add_subdirectory(Mesh) add_subdirectory(Utility) add_subdirectory(Structure) set(TpCoreFiles $
-
-
file
CMakeLists.txt
-
file
CMakeLists.txt
-
file
CMakeLists.txt
-
file
CMakeLists.txt
-
file
CMakeLists.txt
-
file
CMakeLists.txt
-
file
AugmentedVectorCreator.cpp - #include “AugmentedVectorCreator.h”
-
file
AugmentedVectorCreator.h - #include “Mesh/PolyMesh.h”#include “Mesh/CrossMesh.h”#include “Mesh/Cross.h”#include “Utility/TopoObject.h”#include <tbb/tbb.h>#include <utility>#include <queue>#include <unordered_map>
-
file
BaseMeshCreator.cpp - #include “BaseMeshCreator.h”
-
file
BaseMeshCreator.h - #include <vector>#include <unordered_map>#include <tbb/tbb.h>#include “TopoLite/Mesh/PolyMesh_AABBTree.h”#include “Mesh/CrossMesh.h”
-
file
CrossMeshCreator.cpp - #include “CrossMeshCreator.h”#include “tbb/tbb.h”
-
file
CrossMeshCreator.h - #include “TopoLite/Utility/TopoObject.h”#include “TopoLite/Mesh/CrossMesh.h”#include “TopoLite/Mesh/PolyMesh_AABBTree.h”#include “BaseMeshCreator.h”#include “AugmentedVectorCreator.h”#include “PatternCreator.h”#include “Eigen/Dense”#include <vector>#include “igl/lscm.h”#include <memory>
-
file
PatternCreator.cpp - #include “Utility/HelpDefine.h”#include “CrossMesh/BaseMeshCreator.h”#include “CrossMesh/PatternCreator.h”#include “Mesh/Polygon.h”#include “Mesh/PolyMesh.h”#include <queue>
-
file
PatternCreator.h - #include <vector>#include “Mesh/CrossMesh.h”
Enums
-
enum
PatternType Values:
-
enumerator
CROSS_SQUARE= 1
-
enumerator
CROSS_RHOMBUS= 2
-
enumerator
CROSS_SQUARE_RHOMBUS= 3
-
enumerator
CROSS_HEXAGON= 4
-
enumerator
CROSS_HEXAGON_RHOMBUS= 5
-
enumerator
CROSS_DODECAGON_HEXAGON_QUAD= 6
-
enumerator
CROSS_OCTAGON_SQUARE= 7
-
enumerator
CROSS_OCTAGON_SQUARE_COLINEAR= 8
-
enumerator
CROSS_DODECAGON= 9
-
enumerator
CROSS_PENTAGON_CROSS= 10
-
enumerator
CROSS_PENTAGON_SNOW= 11
-
enumerator
CROSS_PENTAGON_MIRROR= 12
-
enumerator
Variables
-
const int
MAX_PATTERN_TYPE= 12
-
enum
-
file
ContactGraph.cpp - #include “ContactGraph.h”#include “Utility/ConvexHull2D.h”
Functions
-
void
TemporaryFunction_ContactGraph()
-
void
-
file
ContactGraph.h - #include “ContactGraphNode.h”#include “Mesh/PolyMesh.h”#include “Utility/TopoObject.h”#include “Utility/PolyPolyBoolean.h”#include <string>#include <map>#include <iostream>#include <algorithm>#include <set>#include <tbb/tbb.h>#include <cmath>
Typedefs
-
using
pairIJ= std::pair<int, int>
-
using
-
file
ContactGraphDefine.h
-
file
ContactGraphEdge.h - #include <Eigen/Dense>#include “Utility/HelpDefine.h”#include <Mesh/Polygon.h>
-
file
ContactGraphNode.h - #include “ContactGraphEdge.h”#include <map>#include <memory>
-
file
InterlockingSolver.cpp - #include “InterlockingSolver.h”
Functions
-
void
TemporaryFunction_InterlockingSolver()
-
void
-
file
InterlockingSolver.h - #include <Eigen/Sparse>#include <Eigen/SparseCore>#include <Eigen/Dense>#include “ContactGraph.h”#include “Utility/TopoObject.h”
-
file
InterlockingSolver_Clp.cpp - #include “InterlockingSolver_Clp.h”#include “tbb/tbb.h”#include <Eigen/SparseQR>#include “ClpInterior.hpp”#include “ClpSimplex.hpp”#include “ClpCholeskyDense.hpp”
Functions
-
void
TemporaryFunction_InterlockingSolver_Clp()
-
void
-
file
InterlockingSolver_Clp.h - #include “InterlockingSolver.h”#include “ClpSimplex.hpp”#include “CoinHelperFunctions.hpp”
Enums
-
enum
CLP_SOLVER_TYPE Values:
-
enumerator
SIMPLEX
-
enumerator
BARRIER
-
enumerator
-
enum
-
file
InterlockingSolver_Ipopt.cpp - #include <cassert>#include <iostream>#include “tbb/tbb.h”#include “InterlockingSolver_Ipopt.h”#include <Eigen/SparseQR>#include “Utility/SparseOperations.h”#include <IpIpoptApplication.hpp>
Defines
-
HAVE_CSTDDEF
Functions
-
void
TemporaryFunction_InterlockingSolver_Ipopt()
Variables
-
const double
COIN_DBL_MAX= std::numeric_limits<double>::max()
-
-
file
InterlockingSolver_Ipopt.h - #include “IpTNLP.hpp”#include “InterlockingSolver.h”#include “CoinHelperFunctions.hpp”#include <Eigen/SparseQR>
Defines
-
HAVE_CSTDDEF
-
-
file
InputVar.cpp - #include “InputVar.h”
-
file
InputVar.h - #include <string>#include <map>#include <pugixml.hpp>#include <nlohmann/json.hpp>#include <vector>#include <Eigen/Dense>#include <memory>#include <iostream>
Enums
-
enum
varValueType Values:
-
enumerator
VAR_VALUE_NONE
-
enumerator
VAR_VALUE_BOOL
-
enumerator
VAR_VALUE_INT
-
enumerator
VAR_VALUE_FLOAT
-
enumerator
VAR_VALUE_INTLIST
-
enumerator
VAR_VALUE_MATRIX4D
-
enumerator
-
enum
varGUIType Values:
-
enumerator
GUI_NONE
-
enumerator
GUI_SLIDERFLOAT
-
enumerator
GUI_SLIDERINT
-
enumerator
GUI_CHECKBOX
-
enumerator
GUI_TEXTBOX
-
enumerator
-
enum
-
file
IOData.h - #include “TopoLite/IO/InputVar.h”#include “TopoLite/Mesh/CrossMesh.h”
-
file
JsonIOReader.cpp - #include “JsonIOReader.h”#include <fstream>
-
file
JsonIOReader.h - #include “TopoLite/Utility/HelpDefine.h”#include “IO/IOData.h”#include <string>#include <nlohmann/json.hpp>#include <filesystem>
-
file
JsonIOWriter.cpp - #include “JsonIOWriter.h”#include <fstream>
-
file
JsonIOWriter.h - #include “TopoLite/Utility/HelpDefine.h”#include “IO/IOData.h”#include <string>#include <nlohmann/json.hpp>#include <filesystem>
-
file
XMLIO_backward.cpp - #include “XMLIO_backward.h”#include “CrossMesh/CrossMeshCreator.h”
-
file
XMLIO_backward.h - #include <iostream>#include <unordered_map>#include <string>#include <pugixml.hpp>#include “IOData.h”#include <filesystem>
-
file
Cross.cpp - #include “Utility/HelpDefine.h”#include “Cross.h”
-
file
Cross.h - #include “TopoLite/Utility/GeometricPrimitives.h”#include “TopoLite/Utility/TopoObject.h”#include <unordered_map>#include “Polygon.h”#include <vector>#include <memory>#include <Eigen/Dense>
-
file
CrossMesh.cpp - #include “Utility/HelpDefine.h”#include “CrossMesh.h”
-
file
CrossMesh.h - #include “TopoLite/Mesh/PolyMesh.h”#include “Cross.h”
-
file
Polygon.cpp - #include “Utility/GeometricPrimitives.h”#include “Utility/HelpDefine.h”#include “Polygon.h”#include <igl/triangle/triangulate.h>#include <iostream>#include <set>
-
file
Polygon.h - #include “TopoLite/Utility/GeometricPrimitives.h”#include <Eigen/Dense>#include <vector>#include <memory>#include <string.h>
Enums
-
enum
PolygonType Values:
-
enumerator
POLY_NONE= 0
-
enumerator
POLY_SQUARE_THETA_45= 1
-
enumerator
POLY_SQUARE_THETA_15= 2
-
enumerator
POLY_SQUARE_THETA_75= 3
-
enumerator
POLY_RHOMBUS_THETA_0= 4
-
enumerator
POLY_RHOMBUS_THETA_90= 5
-
enumerator
POLY_RHOMBUS_THETA_120= 6
-
enumerator
POLY_RHOMBUS_THETA_240= 7
-
enumerator
POLY_HEXAGON_TYPE_0= 8
-
enumerator
POLY_HEXAGON_TYPE_1= 9
-
enumerator
POLY_OCTAGON_REGULAR= 10
-
enumerator
POLY_OCTAGON_COLINEAR= 11
-
enumerator
POLY_DODECAGON= 12
-
enumerator
POLY_PENTAGON_CROSS_TYPE_0= 13
-
enumerator
POLY_PENTAGON_CROSS_TYPE_1= 14
-
enumerator
POLY_PENTAGON_CROSS_TYPE_2= 15
-
enumerator
POLY_PENTAGON_CROSS_TYPE_3= 16
-
enumerator
POLY_PENTAGON_SNOW_TYPE_0= 17
-
enumerator
POLY_PENTAGON_SNOW_TYPE_1= 18
-
enumerator
POLY_PENTAGON_SNOW_TYPE_2= 19
-
enumerator
POLY_PENTAGON_SNOW_TYPE_3= 20
-
enumerator
POLY_PENTAGON_SNOW_TYPE_4= 21
-
enumerator
POLY_PENTAGON_SNOW_TYPE_5= 22
-
enumerator
POLY_PENTAGON_MIRROR_TYPE_0= 23
-
enumerator
POLY_PENTAGON_MIRROR_TYPE_1= 24
-
enumerator
POLY_RHOMBUS_TYPE_0= 25
-
enumerator
POLY_RHOMBUS_TYPE_1= 26
-
enumerator
-
enum
-
file
PolyMesh.cpp - #include “Utility/HelpDefine.h”#include “igl/boundary_loop.h”#include “igl/readOBJ.h”#include “Polygon.h”#include “PolyMesh.h”#include <unordered_map>#include <queue>#include <set>
-
file
PolyMesh.h - #include “TopoLite/Utility/GeometricPrimitives.h”#include “TopoLite/Utility/TopoObject.h”#include “TopoLite/Utility/PolyPolyBoolean.h”#include “Polygon.h”#include <Eigen/Dense>#include <nlohmann/json.hpp>
-
file
PolyMesh_AABBTree.h - #include <Eigen/Dense>#include “Mesh/PolyMesh.h”#include <igl/AABB.h>#include <igl/boundary_loop.h>
-
file
ConvexBlock.cpp - #include “Utility/HelpDefine.h”#include “Utility/GeometricPrimitives.h”#include “Mesh/Cross.h”#include “Utility/ConvexHull2D.h”#include “Mesh/PolyMesh.h”#include “ConvexBlock.h”
-
file
ConvexBlock.h - #include <vector>#include “Utility/GeometricPrimitives.h”#include “Mesh/Cross.h”#include “Mesh/PolyMesh.h”
-
file
StrucCreator.cpp - #include “StrucCreator.h”#include <tbb/tbb.h>
-
file
StrucCreator.h - #include <vector>#include “ConvexBlock.h”#include “Mesh/CrossMesh.h”
-
file
Bezier.h - #include <assert.h>#include <math.h>#include <vector>#include <limits>
Defines
-
BEZIER_SIZE_T_FORMAT
-
BEZIER_FUZZY_EPSILON
-
BEZIER_DEFAULT_INTERVALS
-
BEZIER_DEFAULT_MAX_ITERATIONS
-
-
file
ConvexHull2D.h - #include <Eigen/Dense>#include <vector>#include “HelpDefine.h”
-
file
ConvexHull3D.h - #include <Eigen/Dense>#include <QuickHull.hpp>
-
file
GeometricPrimitives.h - #include “TopoLite/Utility/HelpDefine.h”#include <nlohmann/json.hpp>#include <vector>#include <Eigen/Dense>#include <cmath>
Defines
-
POINT_PLANE_UNKWONN
-
POINT_PLANE_INTERSECT
-
POINT_PLANE_POSITIVE_SIDE
-
POINT_PLANE_NEGATIVE_SIDE
-
LINE_PLANE_UNKWONN
-
LINE_PLANE_INTERSECT
-
LINE_PLANE_POSITIVE_SIDE
-
LINE_PLANE_NEGATIVE_SIDE
-
FACE_PLANE_UNKWONN
-
FACE_PLANE_INTERSECT
-
FACE_PLANE_POSITIVE_SIDE
-
FACE_PLANE_NEGATIVE_SIDE
-
-
file
HelpDefine.h - #include <math.h>
Defines
-
UNITTEST_DATAPATH
-
ELEMENT_OUT_LIST
-
FILE_NAME_LENGTH
-
BUFFER_LENGTH
-
MIN_INT
-
MAX_INT
-
MIN_FLOAT
-
MAX_FLOAT
-
FLOAT_ERROR_SMALL
-
FLOAT_ERROR_LARGE
-
CLIPPER_INTERGER_SCALE
-
errexit(s)
-
errexit2(s1, s2)
-
_MAX_STR_SIZE
-
_MAX_LINE_SIZE
-
_MAX_PATH_SIZE
-
_ERROR
-
_ERROR1
-
_ERROR2
-
_OKAY
-
_TRUE
-
_FALSE
-
_TOGGLE(bool)
-
_ToRadian(X)
-
_ToDegree(X)
-
_EPSILON
-
_MAX(a, b)
-
_MIN(a, b)
-
_IN_BETWEEN(v, a, b)
-
M_PI
-
SURFACE_CylinderA60
-
SURFACE_CylinderA80
-
SURFACE_HyperbolicA90
-
SURFACE_SeaShell
-
SURFACE_SphereA60
-
SURFACE_Torus
-
SURFACE_Spindle
-
DBG_DOTP_EPSILON
-
CO_PLANAR_THRES
-
MODEL_HEXAGON
-
MODEL_HEXAGON_5x5
-
MODEL_HEXAGON_10
-
MODEL_SQUARE
-
MODEL_SQUARE_5X5
-
MODEL_SQUARE_10
-
CROSS_L
-
MOBILITY_SCORE_MAX
-
MOBILITY_SCORE_DIFF
-
NONE_CROSS
-
NONE_PART
-
NONE_GROUP
-
NONE_ELEMENT
-
NONE_FACE
-
NOT_FOUND
-
MOBILITY_SPHERE_R
-
CROSS_THETA
-
TILT_SIGN_NONE
-
TILT_SIGN_POSITIVE
-
TILT_SIGN_NEGATIVE
-
INIT_WORLD_POSITION
-
INIT_WORLD_ROT_AXIS
-
INIT_WORLD_ROT_ANGLE
-
INIT_WORLD_SCALE
-
INIT_WORLD_AXES_POSITION
-
INIT_WORLD_AXES_ROT_AXIS
-
INIT_WORLD_AXES_ROT_ANGLE
-
DRAW_POINT
-
DRAW_LINE
-
DRAW_FLAT
-
DRAW_SMOOTH
-
-
file
PolyPolyBoolean.h - #include <clipper.hpp>#include <cmath>#include <Eigen/Dense>#include “TopoObject.h”#include “HelpDefine.h”
-
file
SparseOperations.h - #include <Eigen/Sparse>#include <iostream>
Functions
-
template<typename
Scalar>
voidcreate_identity_SparseMat(SparseMatrix<Scalar> &m, int dim) Create a identity SparseMat object.
- Template Parameters
Scalar:
- Parameters
m: the matrix the createdim: the dimensions of the matrix.
-
template<typename
Scalar>
voidstack_col_SparseMat(const SparseMatrix<Scalar> &B, const SparseMatrix<Scalar> &I, SparseMatrix<Scalar> &C) Concatenate B and I horizontally.
/ B00 B01 B02 | I00 I01 \ C = | B10 B11 B12 | I10 I11 | \ B20 B21 B22 | I20 I21 /
- Template Parameters
Scalar:
- Parameters
B: Left sparse matrixI: Right sparse matrixC: Final sparse matrix
-
void
stack_row_SparseMat(SpMat &B, SpMat &I, SpMat &C) Concatenate B and I vertically.
/ B00 B01 B02 \ | B10 B11 B12 | C = ———- | I00 I01 I02 | \ I10 I11 I12 /
- Template Parameters
Scalar:
- Parameters
B: Left sparse matrixI: Right sparse matrixC: Final sparse matrix
-
template<typename
Scalar>
voidprint_SparseMatTriplets(const SparseMatrix<Scalar> &A) Print out the triplets row, col, value.
- Parameters
A: the sparse matrix to print
-
template<typename
Scalar>
voidprint_SparseMatTriplets(const SparseMatrix<Scalar> &A, const int precision = 0) Print out as a dense matrix.
- Parameters
A: the sparse matrix to print
-
template<typename
-
file
TopoAssert.h
-
file
TopoObject.h - #include “TopoLite/IO/InputVar.h”#include “TopoAssert.h”
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite/CrossMesh
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite/Interlocking
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite/IO
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite/Mesh
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite/Structure
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite
-
dir
/home/docs/checkouts/readthedocs.org/user_builds/topolite/checkouts/latest/src/TopoLite/Utility