DiscussionsIssue archiveOther usage issues

Archived discussion

Building a solid shape from wire..

Other usage issuesFri, 05/08/2009 - 14:1210 replies

Browse this forum
QuestionAuthor

Hi,
Sorry for the newbee question.. :(
Is it possible to define two surfaces and connect them to build a solid?

E.g. can I define two circles that have no point in common and then build a cone-like solid by connecting the circles? If yes, could you outline a strategy to do this?
Right Nnow I have defined 2 wires (circles), and I try to use the Sewing command. This only fuse then together
as one shape. No faces are created. Do I need to manually create those faces?

Thanks a lot in advance.
-entery

Discussion

10 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi,

i think "BRepOffsetAPI_MakePipeShell" is what you need. But you have to connect the two circles with a wire (maybe a single edge from the middlepoint of circle1 to the middlepoint of cricle2).
If you have this, the wires of the two cricles and the connecting wire, you can build a solid through extruding cirle1 into circle to along the connection-wire with "BRepOffsetAPI_MakePipeShell".

BRepOffsetAPI_MakePipeShell piper(connection_wire);
piper.Add(circle1_wire);
piper.Add(circle2_wire);
piper.Build();
piper.MakeSolid();
TopoDS_Shape result = piper.Shape();

I hope this help you.

02Commenter-1

sorry for the typing error, it should be "[...] through extruding circle1 into cricle2 along [...]"

03Author

Hi Marco,
Thanks for the reply..

Im sorry, the description in my post was not accurate. Its not a cone im looking for.
I have two wires for two different circles. They have the same position but different
radius. And the wire is defined in XYZ plane. I already been trying out the following
functions BRepPrimAPI_MakePrism and BRepSweep_Prism, with no luck. They only work for
a circle wire in 2D plane.
You can see the result Im having now, with the following link.

http://img142.imageshack.us/img142/9223/extrude.png

As you can see, it not a closed shape yet.

What is my options here. Do I need to create every face manually, like I did in DirectX
API ?

Have a nice day,
-entery

04Commenter-2

To build a Solid you would need to extrude a Face instead. In your case I guess what you would have to do is to create a Face from both circles then cut the bigger circle with the smaller one. The resulting cut Face is what you would extrude to get the Solid.

05Author

Hi,
Thanks for responding!
I dont know what im doing wrong here. Im using the BRepBuilderAPI_MakeFace
function to make a face for the inner and outer circle wire but when I call the
IsNull() property for the face its returning true. If im instead using a wire for
circle in 2D plane the same property is not null. Is this just a limitation in
BRepBuilderAPI_MakeFace function or is it me doing it all wrong here?

-entery

06Commenter-3

Hey,

You should check out the 'bottle' source code. It covers some very basic ideas.

* Creating geometry
* Creating edges from geometry
* Creating wires from edges
* Creating faces from wires
* Creating solids from faces
* Hollowing out the solid.
* Applying fillets to edges
* Creating a lofted helix feature (threads)

Good stuff for us n00bs ;)

07Author

That's been that source code I have based my work on.
But im afraid it's not helping me now.

For some reason, I can't make faces from the wire I have.

08Commenter-3

Have you checked out Roman Lygin's blog? There is an example with a washer-shaped surface. Similar to your example. Tons of insight on the blog.

Here is the 5th installment in the series.

Topology and Geometry

09Commenter-4

Hi,
You can use the "Boolean Operation" from the BRepAlgoAPI_Cut class, the code follows bellow:

TopoDS_Face bigFace = BRepBuilderAPI_MakeFace(bigWire);
TopoDS_Face smallFace = BRepBuilderAPI_MakeFace(smallWire);
TopoDS_shape temp = BRepAlgoAPI_Cut(bigFace, smallFace);

The temp shape can be stretched to a solid by using BRepPrimAPI_MakePrism class.

Have a try, good luck!

10Commenter-5

Cool, the boolean faces is a great trick zhangzhigang, thanks.