C# code problem: very very confused

Hi!

I am trying to move the code kindly provided by Laurent Delrieu here (works on Mac OMG) Voxel problem: 'Volume Cube' equivalent in gh - #16 by laurent_delrieu. to a gh file.

The problem is, when I open up the C# module on my computer (Mac system), it’s not making sense to me (I have three windows and a bunch of errors). Am I using wrong version of Rhino? (the python version works just fine and there is only one window)


(I figured that where it says ‘using’ should be in the ‘using’ window, and the ‘runscript’ stuff should go into the ‘script’ window. Right now it says I need to go into ‘preview’ mode, which I found I need to set the correct C# version. But I can’t find it anywhere to do this)

My file is:
mesh.gh (12.6 KB)

Many Thanks,

In all tutorials/topics I found, the C# editor should look like this C# script not working and everything works. If I move all the code into one of the windows, it doesn’t work either

Well there’s a few things wrong with your script. You should maybe spend some time and get more familiar with how to read exception errors.

Now you didn’t internalize your inputs for your component, so I couldn’t test to see if it works.

Thanks for your help! I put together the inputs here: (took me a while to find the modules from their just-picture-no-words version)
mesh_inputs.gh (12.8 KB)

Also, I wanted to let you know that a very important part of the project this code goes to doesn’t work on my computer, so I’m pretty nonchalant about this code now :sob:. I’m grateful for your help but I just wanted to clarify the urgency since code problems like this take a ton of time!

The 2 functions I moved to Custom Additional Code I belive will need to go in the 3rd mac editor window (Overrides?)

It should work after you fix the errors.

1 Like

It’s a Sign > sell/donate the @@#$@ computer > ride (when it works) a proper lethal Ducati > die and let’m live (and/or forget all that stuff).

But if you insist:

Mesh_inputs_HardToSeeThePoint.gh (7.9 KB)

1 Like

Here is the tool.
Disable solver before opening it, delete Dendro if it doesn’t work on your Mac. Dendro was just used to get a clean mesh. It is not mandatory. You can use Rhino to lower the resolution of the mesh before going to QuadRemesh.

Change the resolution to 20 or 30.
I didn’t post the code because I think it is good to struggle a bit in order to go a bit deeper in the understanding and also you seems to be like a “mad dog” (French expression) you seems to go everywhere.
julia 3D.gh (9.8 KB)

3 Likes

Thank you Laurent. Your file prompt me to install 'Dendro 0.9something". Somehow it did, but the Dendro modules don’t work (as expected :disappointed_relieved: :cry: :sob:)

I put together a python (this language I do fortunately understand :melting_face:) implementation of the code below. It’s probably super slow, considering gh doesn’t allow multiprocessing (it says that my python multiprocessing package is called _multiprocessing and doesn’t exist?)

In any case, I think I received enough hints from this project to go to a windows platform. The only missing piece now is for food4rhino come online so I can install Dendro there.
mesh.gh (21.1 KB)

Also I think Dendro’s smoothing is really important here. The mesh from Blender has these little ‘dots’/pockets of mesh all over the place and it really interferes with the remeshing

You can implement native .NET multithreading in GHPython (i.e. IronPython). See a recent example here:

Thanks for your help! I wasn’t able to get ForEach to work (not related, but it seems to not be python code?). However, I found that ghpython.parallel is a substitute

Thanks for your help! In unrelated note, I unfortunately tried to replicate this in python as well and. Let’s just say I now understand why this code is in c# in the first place!

Thanks for your help! I (or rather Laurent) finally got this code to work. It looks like the ‘helper functions’ belong in the override section (literally a separate window on Mac c# editor, for some reason!)

Yes, that’s what I mentioned earlier.

It is actually the same. Or rather, one wraps the other: