Converting bspline surface object into an entity

Technical discussions
Post Reply
Peter_j19
Posts: 2
Joined: Wed Jun 26, 2019 10:02 am

Converting bspline surface object into an entity

Post by Peter_j19 »

Hi all,

The problem, I'm currently on is to display a BSplineSurface as an entity. As the model only takes entity objects, and the constructor (generator) does not take any parameters, it would mean that there must be a way to prepare the surface, which I have as IBSplineSurface_DG, as an entity. Any suggestions on working around this please, or if my reasoning is incorrect.

Thanks very much,
Peter

motif
Posts: 4
Joined: Fri Jul 12, 2019 3:52 am

Re: Converting bspline surface object into an entity

Post by motif »

Hi Peter
One way (C#):

Code: Select all

IEntity_DG entity = model.AddNewBRepShape(ShapeType_DG.eShTypeFaceDG);
IBRepGeometry_DG geometry = entity.GetGeometry() as IBRepGeometry_DG;
IBRepFace_DG face = geometry.GetShape() as IBRepFace_DG;
IUVSurface_DG uvSurface = bsplineSurface as IUVSurface_DG;				// Your surface
face.SetSurface(uvSurface);
After that the surface should show up in 3d and can be saved
Cheers

Peter_j19
Posts: 2
Joined: Wed Jun 26, 2019 10:02 am

Re: Converting bspline surface object into an entity

Post by Peter_j19 »

Thank you, motif!
This works

SyWind
Posts: 4
Joined: Tue Jan 15, 2019 9:00 pm

Re: Converting bspline surface object into an entity

Post by SyWind »

I recommend executing iview.Reset() in the end otherwise you can get a confusing empty screen because the object is too big, too small or outside of the view.

Post Reply