Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turning extruded point arrays into solids? #9

Open
bennlich opened this issue Mar 25, 2014 · 1 comment
Open

Turning extruded point arrays into solids? #9

bennlich opened this issue Mar 25, 2014 · 1 comment

Comments

@bennlich
Copy link

Is there currently a way to represent a closed object in iGeo? For example, if I want to extrude a surface? I saw iBox, which looks like one representation, but I didn't see anything more general. I suppose meshes can be closed?

@sghr
Copy link
Owner

sghr commented Mar 27, 2014

There is extrude method in IG class and also cap method generating a brep as IBrep instance.
For example,
ICurve crv = new ICurve(IG.v(0,0,0, 10,0,0, 10,20,0, 0,10,0), true); // true is to close the curve
ISurface srf = IG.extrude(crv, IG.v(0,0,30));
IBrep solid = IG.cap(srf);

However, cap and brep is still a bit experimental and it has bugs.
You could also directly build IBrep instance out of surfaces and turn on closed flag but this is more experimental and tricky now.

If you are making 3D printable solid, I'd do with polygon mesh as IMesh instance, but you'd need to build all vertices and faces by yourself.

IVertex[] v = new IVertex[]{ new IVertex(0,0,0), new IVertex(0,10,0), new IVertex(10,0,0), new IVertex(0,0,20), new IVertex(0,10,20), new IVertex(10,0,30) };
IMesh mesh = new IMesh();
mesh.addQuads(new IVertex[]{ v[0],v[1],v[4],v[3] });
mesh.addQuads(new IVertex[]{ v[1],v[2],v[5],v[4] });
mesh.addQuads(new IVertex[]{ v[2],v[0],v[3],v[5] });
mesh.addTriangles(new IVertex[]{ v[2],v[1],v[0] });
mesh.addTriangles(new IVertex[]{ v[3],v[4],v[5] });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants