Grasshopper

algorithmic modeling for Rhino

Hi Clemens,

I was wondering whether it were possible to change a beam's cross-section using a script in karamba.

I want to use it to run a loop optimization within a custom component.

Thanks!

Lorenzo

Views: 770

Replies to This Discussion

Hey Lorenzo,

please have a look at the c# script component in the attached grasshopper definition where I assign a new cross section to the first element of the model. Please read the karamba 1.1.0 Hacker’s Essentials, in particular this sentence: "Before running your script in GH make sure to unhook the Memory load *.GHA assemblies using COFF byte arrays after typing GrasshopperDeveloperSettings in the Rhino text window."

Cheers,

Rob

Attachments:

Hi Robert,

Thanks for the script. I had already tried that approach but with a script that also analyzes the model and it seems not to update the crossection afterwards.

Attached is what I get.

Attachments:

Hi Lorenzo,

I understand the problem, but couldn't find a solution. I would also be happy if there were a solution by the Karamba team, I guess it's only one line of code where you update the model completely.

I added line 153 to your script and now the beam elements can refer to a cross section that is known to the model, but that doesn't solve the problem. It's interesting that the stresses are updated in the component whereas the displacements stay the same. When you disassemble and assemble the model again, the cross sections are updated correctly. I am confused...

Another problem I faced is the issue of changing the model upstream in the grasshopper definition. Cloning as discussed here doesn't solve this (http://www.grasshopper3d.com/group/karamba/forum/topics/scripting-s...).

Attachments:

Hi Lorenzo,

the two attached files show how to set up a custom cross section optimizer for beam elements. It should work with Karamba 1.2.2.

'DesignCroSecOpti.cs' contains the abstract base class for custom optimizers. 'DesignCroSecOpti_Simple.cs' shows how to use this in order to implement a simple optimizer.

The code was created in the course of the research project NFormations (see http://www.nformations.com/)

Best,

Clemens

Attachments:

Hi Clemens,

How exactly are those scripts used in Grasshopper with Karamba?

I'm not sure what to do with those files.

Best,

Umar

Hi Umar,

this source code is supposed to be used as part of a Visual Studio Project for a Grasshopper plug-in.

For details on how to use Karamba within your scripts see https://www.karamba3d.com/download/hackers-essentials-2/?wpdmdl=434....

Best,

Clemens

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service