高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】odgeconegetheight90
odgecone::getheight()
odgecone::getheight()
hi,
can somebody explain what the interval returned by odgecone::getheight() means?
what does it represent geometrically?
thanks,
lowell
odgecone::basecenter()
the point returned is half way up the cone, on the axis. is that the way its supposed to be?
thanks,
lowell
base of the cone do not trim the surface. cone surface may extend from the base in both directions. getheight returns the interval of surface along the simetric axis. zero heigt correspond to the base of the cone. it increases along the axis of symmetry.
sergey slezkin
odgecone::basecenter()
ok, i think i understand your explaination, but it doesn't match with the results i see from the interface. or maybe i didn't understand you - is there any written documentation on odgecone anywhere?
if i did understand,. it appears that the values returned may not be corrent.
if i make a cone in autocad:
base at 0,0,0 radius 1.0, height 2.0 axis 0,0,1:
odgecone::basecenter() returns 0,0,1
odgecone::apex() returns 0,0,2
odgecone::getheight( range),
range.getbounds( h0, h1)
h0 == 0.0, h1 == 2.2360679774998
the value of range.m_upperparam ( 2360679774998) is the distance from the apex to a point on the base of the cone, not parallel to the axis.
thanks,
lowell
v = 0 correspond to the base of the cone. v is dimensionless and increases in the direction the axis of symmetry. it is scaled against the initial base radius of the cone.
h (2.24) = 2 / sin( angle )
last edited by sslezkin; 3rd december 2003 at 08:07 amfff">.
odgecone::getheight()
this is not at all clear to me. i need a more explicit answer.
what i am trying to do is to convert to a cone form that uses the following information:
point at the tip of the cone
axis direction
point at the center of the circle that trims the cone at the big end
radius of the circle that trims the cone at the big end.
if the cone is truncated,
point at the center of the circle that trims the cone at the small end
radius of the circle that trims the cone at the small end.
what information do i use from odgecone, and how so i use it to get what i need?
lowell
our realization of odgecone is different from arx. this is bug, and i will fix it in next release.
in current toolkit version :
height is equal to u parameter of autocad, i.e. it is scaled distance from point on lower circle to point on cone surface. for example if you need height(0, 2) call setheight(u1 ,u2) after calculations
u = h / baseradius / cosineangle
btw : getenvelope and getheight return requal intervals. they will different in next release.
thank you for answering, but i would still like to know the answer to the question in my last post:
what information do i use from odgecone, and how so i use it to get what i need?
it would be great if there were some written documentation on this. i am really not clear at all about getheight() and now that you mention getenvelope(), i don't understand it either.
is there written documentation?
how do i convert to tip & bottom circle representation of a cone?
thanks,
lowell
documentations : try download arx documentation from
also read description section in odgecone.h
about your problem :
double a = 30.; // cones angle
double sina = -sin(a / 180. * 3.14159); // sin
double cosa = cos(a / 180. * 3.14159); // cos
odgecone cone; // sample cone
cone.set(cosa, sina, odgepoint3d(), 1, odgevector3d(0,0,1));
odgepoint3d ap = cone.apex();
double apexu = cone.paramof( ap ).x;
double pnt1u = apexu * 0.7;
double pnt2u = apexu * 0.3;
// you can use cone.paramof().x for calculation u parameter of
// point from top/bottom circle.
// double pnt1u = cone.paramof( toppnt ).x;
// double pnt2u = cone.paramof( bottompnt ).x;
// uncomment lines in next release
// pnt1u = cone.heightat( pnt1u );
// pnt2u = cone.heightat( pnt2u );
cone.setheight(odgeinterval(pnt1u, pnt2u));
so if you have only two circles from top and bottom of cutted cone:
1. set base point and base radius to center and radius from bottom circle
2. set cone axis to (top circle center - bottom circle center)
3. calculate cosa, sina somehow
4. call cone.set( ..... ) with data from 1,2,3
5. get any point from top circle ( toppnt )
6. get pnt1u by cone.paramof( toppnt ).x
7. get any point from bottom circle ( bottompnt )
8. get pnt2u by cone.paramof( bottompnt ).x
9. call cone.setheight(odgeinterval(pnt1u, pnt2u));
the example you posted is for making a cone in the od toolkit. what i asked for is information on reading a cone from the od toolkit and converting it to a form i can use.
given the information i can get from od:
apex
base
heights
axis
etc.
how do i find the centers of the circle(s) that trim the cone?
i understand about propogating the half angle along the axis starting at the apex to get the radii.
what i do not understand is how to find the distance along the axis, starting at the apex, to the center(s) of the trimming circle(s)
ok, i understand what you want.
one question before... have you cutted cones of any form (a)
or (b)
1. trimming loops are always circles.
2. normal of trimming circles is parallel to axis of cone.
?
in (b) case you need one point from triming circle and ...
odgepoint3d p3d = .... ; // any point from circle
odgevector3d axis = cone.axisofsymmetry();
// center is center of trimming circle
odgepoint3d center = axis.evalpoint( axis.paramof( p3d ) );
i think there is still some misunderstanding.
i am using od toolkit to read a .dwg file that may have a cone surfaces in it.
i don't know anything about the cone except what comes to me from the dwg file via od toolkit.
i want to represent the cone in a way i can use - apex, axis and trimming circle, or two trimming circles if there are 2 trimming circles represented in the dwg file.
i can't tell where the trimming circles are.
thanks,
lowell
//i am using od toolkit to read a .dwg file that may have a
// cone surfaces in it.
do you use odbr classes for getting surfaces?
what is your task in general?
//i don't know anything about the cone except what
//comes to me from the dwg file via od toolkit.
it seems that you use only odbrface.getsurface() method. it is not enough for description of cone object.
//i want to represent the cone in a way i can use - apex,
//axis and trimming circle, or two trimming circles if there are
//2 trimming circles represented in the dwg file.
look at the attached cone.bmp. as you can see cone can have more that 2 trimming circles, it is possible that cone havn't circles, and it can have trimming loops of 'any' form. so you need information about trimming loops also. or do you solve special case (b)? if yes, see my previous answer. if no, read documentation about odbrfacelooptraverser and about all odbr classes.
attached images (66.6 kb, 12 views)
|