Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

what is the sdk function for creating extruded surface?


Recommended Posts

Thanks for the input bryan314. However, I think this will give you a solid (assuming sld means solid). So when you look at the input parameters for this, there are many, a lot of them dealing with what to do inside the surface bounds.

 

The Topic is asking about creating a surface extrude. With this function (see Menu->Create->Surface->Create Surface Extrude) you really only need 1)chain 2) axis of extrusion 3) amount of extrustion. So this should be somewhat easier to program in a chook if the API provides for it, which as the topic starter mentions, doesn't seem to be the case.

Link to comment
Share on other sites

my code.

biggrin.gif

code:

 

extern "C" __declspec(dllexport) int m_main (int not_used)

{

AFX_MANAGE_STATE(AfxGetStaticModuleState());

 

MC_BOOL succf;

DB_LIST_ENT_PTR e_ptr;

 

surf_type surf;

memset(&surf,0,sizeof(surf_type));

surf.s.type = TABCYL_SURF;

ent e;

memset(&e,0,sizeof(ent));

e.id=A_ID;

e.u.ar.r=50.;

e.u.ar.view=2;

e.u.ar.sa=0;

e.u.ar.sw=P5_PI;

vec_3d (50., 0.0, 0.0, e.u.ar.ep1);

vec_3d (0.0, 0.0, 50., e.u.ar.ep2);

store_ent (&e, &surf.u.tabcyl.pcurve, ALIVE_BIT, main_color, main_level, main_attrib, &succf);

vec_3d (0.0, 100.0, 0.0, surf.u.tabcyl.line);

surf.u.tabcyl.l_sin_ang=0;

memset(&e,0,sizeof(ent));

create_nurbsurf_from_surf(&surf, &e);

store_ent (&e, &e_ptr, ALIVE_BIT, main_color, main_level, main_attrib, &succf);

draw_ent(&e,e.color);

return MC_NOERROR;

}


cheers.gif

but it's not hilighted by mouseover.. I dont know why??

Link to comment
Share on other sites

Takashi,

Some things I noticed...

 

1) The arc center point is not defined and it must be. It is not calculated from the endpoints.

Define the Center point (in VIEW co-ordinates, not WORLD) and then you can just use

arc_ep_3d(&e.u.ar, e.u.ar.ep1, e.u.ar.ep2)

to generate the endpoints.

 

2) the 'surf' needs to be better defined. I would use...

 

surf.s.minu = 0.0; // since the arcs start t = 0

surf.s.minv = 1.0; // since the arcs end t = 0

surf.s.minv = 0.0;

surf.s.maxv = 1.0;

surf.u.tabcyl.l_sin_ang = 0.0;

surf.s.f.closed_u = FALSE;

surf.s.f.closed_v = FALSE; // TRUE if the arc is 360 degrees

surf.s.f.along = FALSE;

surf.s.f.upu = TRUE;

surf.s.f.upv = TRUE;

surf.s.f.ready = TRUE;

surf.s.f.ready = TRUE;

surf.s.type = TABCYL_SURF; // this is critical - telling Mastercam what the surface type is.

Link to comment
Share on other sites

Pete, I'm kind of curious why the SDK doesn't have the function to create a surface. I was under the impression that anything in the Mastercam environment could be accessed through the SDK functions. Maybe the "Create Surface Extrude" function in Mastercam is linking to something like Takashi and you are coding yourselves? How does the SDK work? I thought an SDK just allowed access to the code used to develop the software? I'm not computer engineer, so I'm sure I'm missing a fundamental element of SDKs.

Link to comment
Share on other sites

-----

"...I thought an SDK just allowed access to the code used to develop the software? ..."

-----

 

It's a little more complicated than that. We've always felt that the idea of a C-hook is to ADD functionality, not duplicate it, so not everything needs to be exposed. There are lots of other reasons why things don't make it in to the SDK. For one thing, not that our documentation is the greatest, but there's soooo much code here that it'd be almost impossible to document it all. Also, we don't expose everything since we could end up competing with ourselves if say, someone starting maketing a C-Hook with Level 3 functionality (surface machining) and sold it on top of our Level 1 product.

Link to comment
Share on other sites

That all makes sense thanks for the info.

 

Thanks for ideas about

 

create_nurbsurf_from_surf

 

and

 

TABCYL_SURF

 

Based on the required inputs to that function and the surface type, I think this is the easiest and best (for this application) to replicate the Create->Surface->Create Surface Extrude... routine.

 

It does seem backwards to me to be using the create nurbs surface function for create a very simple surface (since nurbs are capable of creating the most complicated of surfaces).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...