USER FORUM
(you are viewing a thread; or go back to list of threads)
Help to add Edge into SMesh (by cean wang)
Hi,
I am trying to add Edge into SMesh.
1. class SMesh is defined in polygon.h
I added:
List<SEdge> le;
void AddEdge(const SEdge *se);
void AddEdge(Vector a, Vector b);
2.the code is in mesh.cpp
I added:
void SMesh::Clear() {
l.Clear();
le.Clear();
}
void SMesh::AddEdge(Vector a, Vector b) {
SEdge e = {};
e.a = a;
e.b = b;
AddEdge(&e);
}
void SMesh::AddEdge(const SEdge *se) {
le.Add(se);
}
The code compiled, but when run the program crashed.
Any idea where I should look into?
Regards,
Cean
I am trying to add Edge into SMesh.
1. class SMesh is defined in polygon.h
I added:
List<SEdge> le;
void AddEdge(const SEdge *se);
void AddEdge(Vector a, Vector b);
2.the code is in mesh.cpp
I added:
void SMesh::Clear() {
l.Clear();
le.Clear();
}
void SMesh::AddEdge(Vector a, Vector b) {
SEdge e = {};
e.a = a;
e.b = b;
AddEdge(&e);
}
void SMesh::AddEdge(const SEdge *se) {
le.Add(se);
}
The code compiled, but when run the program crashed.
Any idea where I should look into?
Regards,
Cean
(no subject) (by cean wang)
Fixed the crash. Edges are added into a list. How to display them?
Where is the code to display the STriangles?
Where is the code to display the STriangles?
(no subject) (by Paul)
Edges of all triangles can be displayed by clicking one of the icons at the top of the text window. These are not separate objects, but there is a lot of code to identify edge types like silhouette edges and such.
Why do you want to create separate edges? I know FEA results, but be more specific than that. What are you trying to show? What shading capabilities does it need? Do you want to add displacements? Color gradients? What? And why edges?
I guess more importantly (to me) do you want to add features to upstream SolveSpace or are you just hacking it on your own?
Why do you want to create separate edges? I know FEA results, but be more specific than that. What are you trying to show? What shading capabilities does it need? Do you want to add displacements? Color gradients? What? And why edges?
I guess more importantly (to me) do you want to add features to upstream SolveSpace or are you just hacking it on your own?
(no subject) (by cean wang)
Yeah, that icon is just what I want. Seems I don't need to reinvent the wheel now.
I have tried both 2d(tri and Quad) & 3d element. Also I want to show 1D element with color for truss. For Quad, a SRectangle will be more convenient than drawing with two STriangles.
To show fea result is my next step. Displacement is the first to test. Color gradient is really needed. To add displacement into STriangle seems straight forward, but also need for other type of element. I would be very happy if I could animate the deformation. Is it easy in SS?
Sure I want theses features in upstream.
I have tried both 2d(tri and Quad) & 3d element. Also I want to show 1D element with color for truss. For Quad, a SRectangle will be more convenient than drawing with two STriangles.
To show fea result is my next step. Displacement is the first to test. Color gradient is really needed. To add displacement into STriangle seems straight forward, but also need for other type of element. I would be very happy if I could animate the deformation. Is it easy in SS?
Sure I want theses features in upstream.
Post a reply to this comment: