January 22, 2020, 12:32:22 PM

Author Topic: Turn 2D Poly into a 3D poly extruded  (Read 199 times)

Offline Hardcoal

  • Sr. Member
  • ****
  • Posts: 369
Turn 2D Poly into a 3D poly extruded
« on: December 16, 2019, 01:23:26 PM »
hi.. i once programmed such a thing but.. i kinda lost the code..

Anyone has a code to turn 2d poly coords into a 3d volumatic mesh?
If not ill just have to redo it again..
Happy New Year

Offline _PJ_

  • Jr. Member
  • **
  • Posts: 41
Re: Turn 2D Poly into a 3D poly extruded
« Reply #1 on: December 17, 2019, 11:29:52 AM »
There was some B3D routine for this on the old Blitzbasic archives (so it ought to have been ported over here?). I think it assumed the 2D poly was on a plane and extruded fixed-height 3rd dimension from this.

I will dig out that old code later if you don't have another answer by then.


Offline Hardcoal

  • Sr. Member
  • ****
  • Posts: 369
Re: Turn 2D Poly into a 3D poly extruded
« Reply #2 on: December 17, 2019, 01:27:37 PM »
Great man..
if not.. it wouldnt be too hard to remake I beleive :)
Happy New Year

Offline _PJ_

  • Jr. Member
  • **
  • Posts: 41
Re: Turn 2D Poly into a 3D poly extruded
« Reply #3 on: December 17, 2019, 02:31:14 PM »
Yeah I think something like jsut checking for polygon vertices in the 2d plane from which to extend a normal which marks an edge towards the 3rd dimensional vertex. This would give you a series of serrated triangles which can be paired with similar triangles.

If you're only dealing with convex polygons, you could create a cylinder and modify vertices at the "ends" accordingly.