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:

create_nurbsurf_from_surf


Recommended Posts

I use this function to create a simple extruded surfaces from an arc. However, when I finish the the chook that creates this function, I cannot select any of the surfaces that were created with my mouse pointer in the graphical environment. I looked into the database and when I report it, it says "4 Surfaces" were created. But the rest of my surfaces are called "Trim Surfaces". Why can't I select the generic "Surfaces" type that were created by my chook? And, is there another function to create "trim surfaces" instead of the "create_nurbsurf_from_surf" function I'm using?

Link to comment
Share on other sites

arenner,

 

create_nurbsurf_from_surf() doesn't put the surface in the database. It needs to be followed up with a call to put_surf_in_db().

How are you defining the surface that's being passed into create_nurbsurf_from_surf()? Is it a DRAFT_SURF? a TABCYL_SURF?

Please note that making surfaces this way will not make trimmed surfaces - the result of calling create_nurbsurf_from_surf() and put_surf_in_db() will be an untrimmed NURB surface. There's probably no need to worry about trimming if they're simply extruded arcs.

Link to comment
Share on other sites

I believe it is a TABCYL_SURF (dont' have the code in front of me right now). I wasn't aware of the put_surf_in_db(). I'm a little confused on why I need to put them in the database still when they show up with the "Report" function from the Level Manager. I will try this, but do not understand the benefit/use of a "trimmed" surfaces, feel free to explain if you don't mind:)

Link to comment
Share on other sites

Actually, I got this to work. I had to put a rebuild_graphics in bonk.gif . Takashi I think sent me some of this code. As I mentioned, the surfaces show up in the database. That is because I used the "store_ent" and "draw_ent" functions. I'm not sure if this is a bad idea, and should be using something like put_surf_in_db instead? Either way, thanks for the input. If you have any explanation of trimmed surfaces, I'd definitely listen:) Thanks.

code:

 

 

surf.s.type = TABCYL_SURF;

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

create_nurbsurf_from_surf(&surf, &e);

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

draw_ent(&e,e.color);

rebuild_graphics();


Link to comment
Share on other sites

arenner,

Glad to hear you got it working. put_surf_in_db() is simply a wrapper around store_ent() which accepts a 'surf_type' as input.

You shouldn't need the draw_ent() or the rebuild_graphics() - store_ent() does the 'draw' for you. Why did you feel they had to be added?

Trimmed surfaces are a type of surface which contain trimming data and a pointer to an untrimmed surface. If you don't have a real need yet to go there, don't worry about it.

Link to comment
Share on other sites

Trimming Data? I guess that's a new one to me.

 

I'll try it with just the store_ent(). If I put just store_ent and draw_ent, then when my cursor moved over the newly created surfaces, they could not be selected. When I add the rebuild to the end of both of those functions, then I can select and highlight the surfaces. With either situation, the surfaces were reported as such in the Level Manager Report (in the database).

 

I'm wondering if the draw_ent requires the rebuild_graphics. So without the draw_ent function in there, maybe I will be able to select the surfaces after using only a store_ent.

Link to comment
Share on other sites
  • 4 months later...

quote:

put_surf_in_db() is simply a wrapper around store_ent() which accepts a 'surf_type' as input.

Just an observation here: put_surf_in_db must be doing something else other than just being a wrapper. Like arenner noticed, surfaces created by store_ent are not selectable, while those created with put_surf_in_db are.

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...