For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

finding tangents of geomsurface

merve's picture
Forums: 

hi,
sorry for asking too much.
i googled but not found.
is there a built-in way to find tangents(tangent planes) or normals those help us to find tangents of the geom_surface class or tangents of any object that is used to declare surfaces?
thanks

merve's picture

also i read a sentence:

"An original surface normal is defined by cross-product of U and V derivatives, and can be confirmed or reversed by that boolean flag."

u and v in geom_surface is real numbers,
how can i get their derivatives?

as i remember from calculus 2, u and v should be functions for lines, am i wrong, but they are represented as reals in geom_surface?

as you can see i am a bit confused could you advise something?
thanks

jelle's picture

if i recall correct GeomLProps can return you the direction of the principle vectors, and the normal of the surface.
from there its easy to move to a Frenet frame

Fabian Hachenberg's picture

Have a look at
Geom_Surface::D1 (const Standard_Real U, const Standard_Real V, gp_Pnt &P, gp_Vec &D1U, gp_Vec &D1V)

This calculates the first derivatives for a Geom_Surface object

merve's picture

hi thanks for reply

i was planning to ask if for example d1u means "derivative"?

also can i ask,

the D1 function you wrote gets parameters

gp_Vec &D1U

and

gp_Vec &D1V

does these mean derivatives of u and v?

if so, "are u and v functions which can be derivated?"

if so how can u and v handle, with which data type?

arent u and v scaler functions, how can their derivative be vectors?

i must know calculus exactly for doing such work,
but i have a little calculus, hope you share your ideas.

thanks in advance

merve's picture

or is there something to read to learn which member field means what, which function does what?

merve's picture

i think my real problem is that not to be able to reach codes.
i searched for the occ installation directories, but there is no geom_surface.cpp,
but only hxx, thus, where is the functions in the .hxx declared?
why are those hidden :(

jelle's picture

did you check out the doxygen docs? the API docs are fairly ok. are you aware that the 1st derivatives are the tangents of the surface at that point? did you read up on [1]? this really isn't that hard yet ;)
however, you would get _far_ better feedback from this forum if you'd take the time to explain what your objective is Merve!

[1] http://en.wikipedia.org/wiki/Principal_curvature

merve's picture

thanks jelle for detailed replies.
my objective has changed.
i must convert
a geom_surface to a set of points.

i found

gp_Pnt value(Standard real U, Standard_Real V)

method of Geom_Surface.

I know i must iterate in for loops but i have no idea to give which numbers to U and V,
and where to find max and mins of U and V and i dont know if i choose amoun of increment at each iteration.

merve's picture

i ve found

BRepTools::UVBounds ( Face, UMin, UMax, VMin, VMax )

going to research it.
thanks.

jelle's picture

>>>I know i must iterate in for loops but i have no idea to give which numbers to U and V,
>>>and where to find max and mins of U and V and i dont know if i choose amoun of increment at each iteration.

this is to your own liking / intuition Merve, you can subsample a surface up to an infinite resolution...

merve's picture

sorry, there is a mistake by me.
not a surface, a part of a surface, maybe a TopoDS_Face.

jelle's picture

that's just semantics; a Face is topology speak for a surface.
the shape itself is one and the same...

merve's picture

i think Face is representing a restricted area, a restricted part of surface, isnt it?

and cant i do something like this:

for(double u=umin;u for(double v=vmin;v

points.add(face.value(u,v));
}
}

is this possible

jelle's picture

absolutely

merve's picture

thanks very much jelle