Angus Wang
Angus Wang

Reputation: 3

How to draw bounded b-spline surface in OpenGL?

I want to draw a bounded b-spline surface with 26 b-spline boundary curves.

image

I can draw b-spline surface (without any boundary) in OpenGL, but it is too difficult for me to draw surface and fit the boundary curves.

Any suggestions or ideas are appreciated.

https://drive.google.com/file/d/0ByjklWbi44oBZDhocGdNLWNvUWM/view?usp=sharing

PS: The Files is a sample in .stp format

Upvotes: 0

Views: 1657

Answers (1)

fang
fang

Reputation: 3633

B-spline surfaces are naturally bounded. So when you say B-spline surface without any boundary, I think you are talking about untrimmed B-spline surfaces and what you want to do is to be able to draw trimmed B-spline surfaces.

Drawing a surface typically involves tessellation, which turns a continuous surface into a triangle mesh consist of many small triangles. Therefore you will need to do the following:

  • Find the surface parameter curve (SP curve) of the boundary curves. The SP curve is a 2D curve defined on the parametric domain of the B-spline surface.
  • Tessellate the 2D region on the parametric domain enclosed by all SP-curves.
  • Map the 2D tessellation on parametric domain back to 3D space to find the 3D triangle mesh.

Step 1 and step 2 are both non-trivial. So, indeed this will be a large task if you don't have any 3D library at your disposal and have to implement everything by yourself.

Upvotes: 1

Related Questions