It is currently Sat Aug 22, 2020 3:37 am


All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: python bindings
PostPosted: Mon Jan 23, 2017 11:12 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Great, glad you got it working :-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Tue Jan 24, 2017 5:03 pm 

Joined: Mon Oct 15, 2012 4:33 pm
Posts: 52
David Williams wrote:
Great, glad you got it working :-)

Thank you! :)

I created a github repo if someone is interested of my experiments: https://github.com/kalwalt/sverchok_nodes_collection/tree/master/blend

and issue on sverchok https://github.com/nortikin/sverchok/issues/1168#issuecomment-274850616


Only a question: i have some troubles with the indices of the mesh, in the sense i can't figure out how they are stored. Since i do not put the indices in a vbo i have to recreate the list of edges or polygons by code. How shoul i manage them?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Wed Jan 25, 2017 9:29 am 

Joined: Mon Oct 15, 2012 4:33 pm
Posts: 52
Quote:
Only a question: i have some troubles with the indices of the mesh, in the sense i can't figure out how they are stored. Since i do not put the indices in a vbo i have to recreate the list of edges or polygons by code. How shoul i manage them?


i solved that issue, polyvox output tris so was easy to fix it. Now we have a polyvox voxilized sphere inside blender!!
A new era began.... :D

Attachment:
File comment: Polyvox inside Blender!
Schermata del 2017-01-24 23-51-41.png
Schermata del 2017-01-24 23-51-41.png [ 158.88 KiB | Viewed 7605 times ]


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Thu Jan 26, 2017 9:37 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Wow, cool stuff! I've never seen PolyVox in Blender before :-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Fri Jan 27, 2017 10:30 pm 

Joined: Mon Oct 15, 2012 4:33 pm
Posts: 52
David Williams wrote:
Wow, cool stuff! I've never seen PolyVox in Blender before :-)

There is always a first time!

i tried to import also the LargeVolume but it seems that something is broken at that point of the commit i was receiving an error conceirning a compressor not assigned, this the output from the Paging example:

Code:
  PolyVox Assertion Failed!
    =========================
    Condition: m_pCompressor
    Message:   You must provide a compressor for the LargeVolume to use.
    Location:  Line 452 of /home/walter/polyvox-bitbucket-wperdan/polyvox/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl


Did you remember maybe when this bug has fixed?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Tue Jan 31, 2017 12:01 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I'm not sure this is a bug (though I guess you can say it is a bug if it occurs in the example). The idea used to be that you had to provide an object implementing a compression algorithm which would be used when the LargeVolume became low on space. At different points in PolyVox's history this was compulsory or not compulsory, but there should at least be a default compressor implementation somewhere in PolyVox?

At any rate, I wouldn't worry too much about the LargeVolume. It adds some complications compared to RawVolume and is not really needed until your volume are bigger than about 512x512x512 voxels. In my experience it is actually the size of the generate mesh data which becomes a problem first.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Wed Feb 01, 2017 10:58 pm 

Joined: Mon Oct 15, 2012 4:33 pm
Posts: 52
Quote:
At any rate, I wouldn't worry too much about the LargeVolume. It adds some complications compared to RawVolume and is not really needed until your volume are bigger than about 512x512x512 voxels. In my experience it is actually the size of the generate mesh data which becomes a problem first.


yes maybe i don't need a Large Volume, i'm primarly focused to create small meshes ( but with high number of polygons), I would be interested also to add directly a material to the voxel, As i remember and i looked at the Api it should be possible use RawVolume with MaterialDensityPair, but i can't found in the python bindings ,Maybe is implemented in another way or there is a different way? You should in theory assign the value voxel with setDensity() method and setMaterial(), Unfortunately the docs in that commit wasn't so clear ( maybe was broken at that he moment) so it's difficult fro me to understand if it's a possible thing or not.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Sat Feb 04, 2017 10:08 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
kalwalt wrote:
As i remember and i looked at the Api it should be possible use RawVolume with MaterialDensityPair, but i can't found in the python bindings ,Maybe is implemented in another way or there is a different way? You should in theory assign the value voxel with setDensity() method and setMaterial()


This is how it should be done, but unfortunately I don't know if it is possible through Python. The problem is that PolyVox makes heavy use of templates but these are not supported by Python. So in the SWIG files for the bindings we have to explicitly define every combination of volume and voxel type which we want Python to support. You can have a look at the '*.i' files to see if it is in there? But I suspected using class types such as MaterialDensityPair is trickier than adding basic types such as int.

This is why I will try to avoid using templates in the public interface of future projects, as it makes writing bindings quite complicated. I've learned a lot of stuff from writing PolyVox!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Sun Feb 05, 2017 4:08 pm 

Joined: Mon Oct 15, 2012 4:33 pm
Posts: 52
Quote:
So in the SWIG files for the bindings we have to explicitly define every combination of volume and voxel type which we want Python to support. You can have a look at the '*.i' files to see if it is in there?

Unfortunately i can't find such def in the *.i files. I think it's time to solve the python bindings definetevely. I have already a fork of polyvox_bitbucket, i will create a new branch
Code:
new_bindings
in my repo and will continue the discussion there. At the moment i'm in stuck with the cubic and MC extractor, I think the Swig template def are not correct. i will post here the link fo the new branch. Actually you can find my polyvox fork here


Top
Offline Profile  
Reply with quote  
 Post subject: Re: python bindings
PostPosted: Sun Feb 05, 2017 4:59 pm 

Joined: Mon Oct 15, 2012 4:33 pm
Posts: 52
I created a pull request on your repo, so we can collaborate there! :)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net