Ogre in CAD-program?
-
- Gnoblar
- Posts: 13
- Joined: Thu Jun 14, 2007 6:25 pm
Ogre in CAD-program?
Hi
I'm planning to design a little CAD-program for my own needs. Not planning to program it myself, i'm just designer.
Question is: Is OGRE capable to handle real-time editing of solids and meshes? Also some 2D-graphics is needed at the same time. Oh. And platform will be OsX of course.
Is it difficult to make some integrations with Core Image and the overcoming Core Animation-systems?
Have I understood it right that OGRE has nothing to do with OpenGL - it actually replaces it?
I'm planning to design a little CAD-program for my own needs. Not planning to program it myself, i'm just designer.
Question is: Is OGRE capable to handle real-time editing of solids and meshes? Also some 2D-graphics is needed at the same time. Oh. And platform will be OsX of course.
Is it difficult to make some integrations with Core Image and the overcoming Core Animation-systems?
Have I understood it right that OGRE has nothing to do with OpenGL - it actually replaces it?
-
- Halfling
- Posts: 72
- Joined: Fri Jun 08, 2007 10:55 pm
yeah
I'm interested in this also. Does Ogre 3D support Nurbs? I think I read some where that it supports Bezier patches. However I would think a CAD system will need nurbs.
I suppose you could always dig through the code and implement a frame work on top of Ogre utilizing OpenGL for nurbs. You could research this topic.
Or implement your own Nurbs system on top of Ogre.
I suppose you could always dig through the code and implement a frame work on top of Ogre utilizing OpenGL for nurbs. You could research this topic.
Or implement your own Nurbs system on top of Ogre.
- simply
- Halfling
- Posts: 45
- Joined: Mon Jun 12, 2006 10:45 am
- Location: Switzerland
- Contact:
Re: Ogre in CAD-program?
Ogre uses either DirectX or OpenGL for rendering. So one can say it's built upon OpenGL!kamelisko wrote:Have I understood it right that OGRE has nothing to do with OpenGL - it actually replaces it?
So Ogre does just the rendering tasks for you. If you wish to alter geometry while your application runs, you can do so. In a game, geometry changes on runtime, too.
NURBS: I don't know anything about that topic, sorry!
- riri
- Gnoblar
- Posts: 10
- Joined: Thu Jun 07, 2007 5:30 am
- Location: Nantes, France
Re: Ogre in CAD-program?
For the first question, yes, but you'll have to code the mesh editing by yourself of course: as already mentionned, Ogre does just rendering (that's already a big task).kamelisko wrote:Is OGRE capable to handle real-time editing of solids and meshes? Also some 2D-graphics is needed at the same time. Oh. And platform will be OsX of course.
for the second question, I'm not sure to understand Maybe searching for OgreMagic ?
- stoneCold
- OGRE Expert User
- Posts: 867
- Joined: Fri Oct 01, 2004 9:13 pm
- Location: Carinthia, Austria
- x 1
As for nurbs, I already have the (yet vague) plan to bring Ogre and NURBS++ together (but ogreswf comes first ).
I actually came to the idea, after seeing the interesting capabilities of NURBS in realtime/games ---> NFS: Carbon.
I also think, that in times where procedural content generation (geometry/textures) NURBS could really be helpful in this manner.
I actually came to the idea, after seeing the interesting capabilities of NURBS in realtime/games ---> NFS: Carbon.
I also think, that in times where procedural content generation (geometry/textures) NURBS could really be helpful in this manner.
my tweets | www.fuse-software.com | home of vektrix (Flash GUI for Ogre3D) and caspin (ActionScript 3 Virtual Machine Wrapper)
-
- Gnoblar
- Posts: 13
- Joined: Thu Jun 14, 2007 6:25 pm
Ok. Ogre is running above OpenGL. So what is actually the benefit of Ogre instead of using just OpenGL? Is OpenGL just a standard how to describe things? I'm little newbie in this level of things..
The main assertation of the real-time renderer is speed. It should be very fast even if there is much stuff visible. Nurbs is not the thing when speaking of CAD, because all objects must be in absolute sizes. What i have experiense of nurbs those are more like visualization only things.
The main assertation of the real-time renderer is speed. It should be very fast even if there is much stuff visible. Nurbs is not the thing when speaking of CAD, because all objects must be in absolute sizes. What i have experiense of nurbs those are more like visualization only things.
- riri
- Gnoblar
- Posts: 10
- Joined: Thu Jun 07, 2007 5:30 am
- Location: Nantes, France
First, Ogre wraps OpenGL and DirectX, so the two 3D implementations are available through one consistent API. It's almost useful for Windows platform where openGL drivers are not always well implemented.kamelisko wrote:Ok. Ogre is running above OpenGL. So what is actually the benefit of Ogre instead of using just OpenGL? Is OpenGL just a standard how to describe things? I'm little newbie in this level of things..
Then, Ogre provides other interesting features, like the Unified shader scripts, resources management (this could be out of Ogre, but I guess the resource loading is optimized for the Ogre internal storage of polygons - again, I guess, I didn't verified).
That's the advantages I can explain from my newbee point of view
-
- Gnoblar
- Posts: 10
- Joined: Wed Jun 13, 2007 8:45 pm
It can be done. I've written a custom module for Pro/Engineer, utilizing the Pro/TOOLKIT API, which exports "all" assembly information, including geometry, cosmetic features (such as text), mass properties etc, to a customized, highly compressed format (about 1-2% of the original size of the Pro/E model). I then wrote a "CAD" viewer using Ogre for this exported file. Some degree of manipulation is also possible, but no geometry is currently constructed/modeled through the interface. That would be the logical next step though.
To get some idea of how complex CAD modeling can be, I suggest downloading Open CASCADE (http://www.opencascade.org) and take a look at the source. All I can say is wow.
To get some idea of how complex CAD modeling can be, I suggest downloading Open CASCADE (http://www.opencascade.org) and take a look at the source. All I can say is wow.
-
- Gnoblar
- Posts: 13
- Joined: Thu Jun 14, 2007 6:25 pm
Well I wasn't thinking so complex CAD-modeling. This CAD will be for building modeling. It doesn't need so complex objects like splines. More important is information beneath the model. At start if I just could do a wall.. (which is a simple box of a modeling point of view)Entity *eMerlin; wrote:It can be done....
To get some idea of how complex CAD modeling can be, I suggest downloading Open CASCADE (http://www.opencascade.org) and take a look at the source. All I can say is wow.
I tried to get those OSX examples work, but only one of them did. (The rotating head - with a little bug) I don't know what is wrong.
I also tried the Xcode example project but it didn't work either. Maybe I should learn using Xcode first...
-
- Gnoblar
- Posts: 10
- Joined: Wed Jun 13, 2007 8:45 pm
Regarding a CAD/Ogre hybrid, one solution may be to write a simplified wrapper using Open CASCADE to do CAD stuff such as constructing primitives (only what you need), solid boolean operations, and tesselation. Then...take the triangular mesh returned from your Open CASCADE wrapper's solid tesselation routine, and then render this triangle list in Ogre, following essentially the same steps as that shown here: http://www.ogre3d.org/wiki/index.php/ManualSphereMeshes
See "Construction of Primitives" and "Boolean Operations" from the Open CASCADE:
http://www.opencascade.org/showroom/shapefactory
Overkill
See "Construction of Primitives" and "Boolean Operations" from the Open CASCADE:
http://www.opencascade.org/showroom/shapefactory
Overkill
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
If it support real geometry (indices and vertices) it could be very useful.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 10
- Joined: Wed Jun 13, 2007 8:45 pm
A good example of how to obtain usable mesh info (after primitive construction, boolean operations), complete with vertices/indices from the resulting solid shape, can be found in the Open CASCADE source file StlTransfer.cxx found under the downloaded OpenCASCADE directory structure, under .\ros\src\StlTransfer:
The hypothetical wrapper may allow for calls similar to:
May seem like messin' with fire though....
Code: Select all
void StlTransfer::BuildIncrementalMesh (const TopoDS_Shape& Shape,
const Standard_Real Deflection,
const Handle(StlMesh_Mesh)& Mesh)
Code: Select all
OgreCascade::addSolid
OgreCascade::cutSolid
OgreCascade::getMesh
-
- Gnoblar
- Posts: 10
- Joined: Wed Jun 13, 2007 8:45 pm
Does OgreOC sound better?
The OC code from above for creating a mesh (not that different than Ogre::Mesh) once you have the resultant solid Shape:
The OC code from above for creating a mesh (not that different than Ogre::Mesh) once you have the resultant solid Shape:
Code: Select all
void StlTransfer::BuildIncrementalMesh (const TopoDS_Shape& Shape,
const Standard_Real Deflection,
const Handle(StlMesh_Mesh)& Mesh)
{
if (Deflection <= Precision::Confusion ()) {
Standard_ConstructionError::Raise ("StlTransfer::BuildIncrementalMesh");
}
Standard_Integer NbVertices, NbTriangles;
BRepMesh::Mesh (Shape, Deflection);
for (TopExp_Explorer itf(Shape,TopAbs_FACE); itf.More(); itf.Next()) {
TopoDS_Face face = TopoDS::Face(itf.Current());
TopLoc_Location Loc, loc;
Handle(Poly_Triangulation) theTriangulation = BRep_Tool::Triangulation(face, Loc);
if (theTriangulation.IsNull()) continue; //Meshing was not done for this face!
Poly_Array1OfTriangle theTriangles(1,theTriangulation->NbTriangles());
theTriangles.Assign(theTriangulation->Triangles());
Mesh->AddDomain (Deflection);
#ifdef DEB
TopAbs_Orientation orientation =
#endif
face.Orientation();
TColgp_Array1OfPnt thePoints(1, theTriangulation->NbNodes());
thePoints.Assign(theTriangulation->Nodes());
//compute normal of face
const TColgp_Array1OfPnt& Nodes = theTriangulation->Nodes();
TColgp_Array1OfDir NORMAL(Nodes.Lower(), Nodes.Upper());
Poly_Connect pc(theTriangulation);
Normal(face, pc, NORMAL);
Standard_Integer i;
for(i=1;i<=thePoints.Length();i++) {
Standard_Real X1, Y1, Z1;
gp_Pnt p = thePoints.Value(i);
p.Transform(Loc.Transformation());
p.Coord (X1, Y1, Z1);
NbVertices = Mesh->AddVertex (X1, Y1, Z1);
}
try {
for (i=1;i<=theTriangles.Length();i++) {
Standard_Integer V1, V2, V3;
Poly_Triangle triangle = theTriangles.Value(i);
triangle.Get(V1, V2, V3);
gp_Pnt P1, P2, P3;
P1 = Mesh->Vertices(Mesh->NbDomains()).Value(V1);
P2 = Mesh->Vertices(Mesh->NbDomains()).Value(V2);
P3 = Mesh->Vertices(Mesh->NbDomains()).Value(V3);
gp_Vec average = NORMAL(V1);;
//check angle between vectors
gp_Vec V1V2(P1, P2), V2V3(P2, P3);
Standard_Integer A,B,C;
gp_Vec vec = V1V2^V2V3;
Standard_Real modul1, modul2;
modul1 = average.XYZ().Modulus();
modul2 = vec.XYZ().Modulus();
if (modul2>Precision::Confusion ()) vec.Divide(modul2);
A=V1;B=V2;C=V3;
// vec.Transform(loc);
if (modul1>Precision::Confusion () && modul2>Precision::Confusion ()) {
Standard_Real an = vec.Angle(average);
if ( an > PI/2) {
A = V3;B=V2;C=V1;
}
else {
A=V1;B=V2;C=V3;
}
}
NbTriangles = Mesh->AddTriangle (A, B, C, average.X(), average.Y(), average.Z());
}
}
catch(Standard_Failure)
{
#ifdef DEB
cout << "Fail in StlTransfer::BuildIncrementalMesh" << endl;
#endif
}
}
}
- SpaceDude
- Bronze Sponsor
- Posts: 822
- Joined: Thu Feb 02, 2006 1:49 pm
- Location: Nottingham, UK
- x 3
- Contact:
You may want to have a look at the Visualization Toolkit Library (VTK) which may be more suitable for CAD work than Ogre is (it has good support for 2D graphics as well as 3D):
http://www.vtk.org/
It is specifically aimed at scientific applications. I must warn you however that the documentation is very lacking. Although the library is open source, they seem to make profit by selling books describing how to use the thing. I have just about managed to get by without the books but it hasn't been a pleasurable experience.
Ogre on the other hand has great documentation, and if you ever run into trouble the people on this forum are generally very helpful.
http://www.vtk.org/
It is specifically aimed at scientific applications. I must warn you however that the documentation is very lacking. Although the library is open source, they seem to make profit by selling books describing how to use the thing. I have just about managed to get by without the books but it hasn't been a pleasurable experience.
Ogre on the other hand has great documentation, and if you ever run into trouble the people on this forum are generally very helpful.
-
- Gnoblar
- Posts: 13
- Joined: Thu Jun 14, 2007 6:25 pm
i checked that out. There was one big thing that doesn't match to my idea:SpaceDude wrote:You may want to have a look at the Visualization Toolkit Library (VTK) which may be more suitable for CAD work than Ogre is (it has good support for 2D graphics as well as 3D):
http://www.vtk.org/
...
My idea is really to be super-fast. Even if we're talking of CAD why shouldn't it use real-time intelligent optimization to view things smoothly?What's UnCool About VTK
Not a super-fast graphics engine...VTK uses C++ dynamic binding and a device independent graphics model.
One thing I haven't asked is that does Ogre have possibility to have paraller view and change it to perspective view on-the-fly?
Maybe my first step is to get the OGRE work and test it a little altough I'm not a programmer..
- xavier
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
Yes.kamelisko wrote: One thing I haven't asked is that does Ogre have possibility to have paraller view and change it to perspective view on-the-fly?
Yes.Maybe my first step is to get the OGRE work and test it a little altough I'm not a programmer..
Creating a CAD tool is also going to be rather tough if you aren't a programmer.
- SpaceDude
- Bronze Sponsor
- Posts: 822
- Joined: Thu Feb 02, 2006 1:49 pm
- Location: Nottingham, UK
- x 3
- Contact:
-
- Gnoblar
- Posts: 13
- Joined: Thu Jun 14, 2007 6:25 pm
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
It's even harder if you are one.. Just on a different level, that's all..SpaceDude wrote:Programming in general is hard if you are not a programmer
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- Evak
- Orc Shaman
- Posts: 707
- Joined: Sun Apr 02, 2006 7:51 pm
- Location: Sacramento, CA
- x 1
- Contact:
Well good luck, it's all well and good having ideas and vision. You don't have to be a programmer to come up with a good design so long as you have done good research and have plenty of hands on experience with render engines, how they work, the limitations and how you overcome them.
Otherwise you really can't conceptualize a product, then communicate in realistic terms things your programmers can understand and make real. You will need a competent programmer to pull off some of the basic things you require.
Otherwise you really can't conceptualize a product, then communicate in realistic terms things your programmers can understand and make real. You will need a competent programmer to pull off some of the basic things you require.