Page 1 of 1

Converting bspline surface object into an entity

Posted: Fri May 15, 2020 3:43 am
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

Re: Converting bspline surface object into an entity

Posted: Mon May 18, 2020 4:33 am
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

Re: Converting bspline surface object into an entity

Posted: Wed May 20, 2020 4:21 am
by Peter_j19
Thank you, motif!
This works

Re: Converting bspline surface object into an entity

Posted: Wed May 20, 2020 4:49 am
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.