Where is the ‘wrap’ param in ExtrudePolygon with version 4.2.0-beta1


There is a wrap param for ExtrudePolygon function in the playground, I update my babylonjs version accord to it. But I am developing with typescript and use babylon.module.d.ts! It seem as the type declaration file of babylonjs has not update to the newest version.

I don’t have a wrap option in the Playground:

So What is this?

It’s a mistake by who did the PG: this parameter is not taken into account (or maybe wrap did exist some time ago and has been removed since then, I don’t know).

I really need this option, maybe the hover hint just use babylon.d.ts which has not update, but running code do not depdend on it.

I hava found the latest commit of this Correction to Side Texture in ExtrudePolygon by BabylonJSGuide · Pull Request #8017 · BabylonJS/Babylon.js · GitHub

In fact it’s an option you can use on PolygonBuilder.ExtrudePolygon, not MeshBuilder.ExtrudePolygon!

1 Like

You are correct!, I didn’t notice that. By the way, I still think the MeshBuilder.ExtrudePolygon should have this option due to the playground exactly do!

This is a bug, the wrap option should be in MeshBuilder.ExtrudePolygon. Since MeshBuilder.ExtrudePolygon calls PolygonBuilder.ExtrudePolygon the option is being passed somehow. Will have a look tomorrow.

1 Like

Javascript does take this option property into account as it is happy to add properties to an object on the fly. So that when MeshBuilder.ExtrudePolygon calls PolygonBuilder.ExtrudePolygon it is picked up by PolygonBuilder.ExtrudePolygon. Typescript, of course, objects to the lack of declaration. Missing it out in MeshBuilder.ExtrudePolygon was the mistake.

PR submitted.

Yes my bad, I didn’t see it was only a problem with the typescript definition.

1 Like