- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
The cosine_ang le of cone is always zero
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-10-2012 05:36 PM
Dear All,
When I try to get the cosine_angle of a cone, so that I can judge if the cone is hole or a pin.
When the cone is a hole, the cosine_angle should be -1. The cosine_angle should be positive 1 if the cone is a pin.
It turned out the cosine_angle in my code is always zero. I am stuck at that point.
My code to derive cone face from the feature selection is attached below:
FACE *PTRFACE = (FACE*)FirstEntity;
CONE* PTRCONE = (CONE*)PTRFACE->geometry();
SPAunit_vector AxisVector = PTRCONE->direction();
SPAposition Root = PTRCONE->root_point();
double sine_angle = PTRCONE->sine_angle();
double cosine_angle = PTRCONE->cosine_angle();
Re: The cosine_ang le of cone is always zero
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-11-2012 05:30 AM
This entity should be a CONE (or cone). Your must check the type of SURFACE (or surface).
Re: The cosine_ang le of cone is always zero
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-11-2012 05:08 PM
Thank you.
but when i followed the instruction, the cosine_angle is always positive 1.
why is that.
FACE *PTRFACE = (FACE*)FirstEntity;
SURFACE *PTRSURFACE = (SURFACE*)PTRFACE->geometry();
surface const &surf = *(surface const*)&PTRSURFACE->equation();
cone const &cone = *(cone const*)&surf;
double cosine_angle = cone.cosine_angle;
Re: The cosine_ang le of cone is always zero
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-12-2012 01:37 AM
You should detect the CONE(cone) surface to obtain its features.
if ( is_cone( &surf ) )
{
cone const &cone = *(cone const*)&surf;
double cosine_angle = cone.cosine_angle;
}
else
{
// no cone!
}

