Opencascade face Normals

Source: Internet
Author: User

Opencascade face Normals

[Email protected]

Abstract. to display a realistic three-dimensional model, the vertex coordinates, vertex normal direction, texture coordinates of the three information are necessary. This article mainly describes how to display the normal vector of the surface in opencascade Draw , and makes it easy to check the normal direction of the surface by using the relevant commands.

Key Words. Face, Surface, Normals

1. Introduction

The normal vector of the point on the surface is an important data for the three-dimensional display program, and his correctness directly affects the response of the curved light to the display effect. As shown in the three-dimensional display of the same ball, different methods to get the display effect is different.

for for OpenGL, the interface glnormal () is provided to set the normal vector. For More surface method vector calculation and related information in Opencascade, you can refer to the original blog:

L topology and Geometry in Opencascade-face

L Surface Normal Vector in Opencascade

L Surface Normal averaging

As you can see from these articles, unlike the general display engine, Opencascade for the model constructed by the modeling algorithm, the normal vector at any point on the surface can be calculated precisely because of the expression of the precise parametric equation. Instead of the normal display engine, the method of calculating the averaging method is used to deal with the vertex normal direction by a similar algorithm.

2. Face Normals

in the The normals command is available in the Draw Test harness in earlier versions of Opencascade to display the surface's normal direction.

Command usage is as follows:

Normals shape [Length {ten}] [-nbalongu {1}] [-NBALONGV {1}] [-usemesh] [-print], display normals

the length of the normal arrow, along the surface parameters, can be set by the corresponding parameters The UV direction displays the number of normal directions, whether the grid is displayed in normal and whether it is printed in the Draw 's command window. The following method of displaying the various faces of a cylinder always illustrates the use of commands. The commands are listed below:

Axo

Pcylinder C 10 20

Normals C

Fit

First Use the command Axo to open a two-dimensional axis survey view.

then use the command Pcylinder to create a cylinder with a radius of tenand a height of .

Use the command normals to display the normal direction of the cylinder with the default parameters;

use the Fit command to zoom in on a two-dimensional axis survey view.

where red indicates that the normal direction is the same as the direction of the display, the blue representation is opposite to the direction shown. Since this two-dimensional axis measurement view can not be arbitrarily rotated, scaled, no three-dimensional view is convenient, so Opencascade also provides a three-dimensional view to display the surface of the normal command vnormals, related parameters set and normals consistent. So the following is mainly in the three-dimensional view of the use of these parameters are described. Where the vnormals command is used as follows:

Displays/hides normals calculated on shape geometry or retrieved from triangulation

Vnormals Shape [{on|off}=on] [-length {ten}] [-nbalongu {1}] [-NBALONGV {1}] [-nbalong {1}]

: [-usemesh] [-oriented {0}1}=0]

when the default parameter is used to display the normal direction of the cylinder above, enter the command directly:vnormals C

because arrows are used in the three-dimensional view to indicate the direction of the normal direction, no color is necessary to distinguish the positive and negative directions. By visible, the bottom side of the normal right should be reversed. The default parameter only displays the normal direction of the geometry plane in the TOPO polygon, without regard to the orientation of the TOPO polygon. the direction of the TOPO face is taken into account by the parametric -oriented Mission Order Display method , that is, the normal direction of the final display. The command is:

Vnormals c-oriented

only one normal is shown on each face, and it is obvious that a normal direction is not enough for a cylindrical face. You can set the number of surfaces in the parameter UV direction by parameter-nbalong and so on .

the normal direction for displaying data, triangular mesh vertices, can be specified by parameter -usemesh . This usage makes it easy to check the vertex and vertex normal direction of the mesh data.

Shows the normal direction of a propeller model surface:

You can also set the parameters on and -length to set the normal display and not display, and the normal display length, here is not elaborate, the reader can test themselves.

3. Conclusion

in summary, Opencascade encapsulates the command normals and vnormals in the Draw Test harness that show the polygon's normal direction . By using these commands, you can easily check that the normal direction of the polygon is correct. In particular, the parameter -usemesh to display the normal function in the grid, which is helpful for the inspection of vertex methods in the display grid data of the model. By finding the relevant command to implement the source code, you can easily find the relevant functions to realize the source code, which is an advantage of open source.

Opencascade face Normals

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.