Quantcast
Channel: Grasshopper - McNeel Forum
Viewing all 40128 articles
Browse latest View live

Working with Lists in Python/GH

$
0
0

@12654987989 wrote:

Hi all,

Please help!

I don’t know how to make it work but here’s the idea:

I have 3 lists that has different list lengths and values and what I wanted to achieve is to specifically select the name of a list through a value list and it will output the assigned list according to its list name.

Any solutions are welcome!

Thanks!

Posts: 2

Participants: 2

Read full topic


List of all components with their explanation / Search for a component based on it explanation

$
0
0

@Manoochehr_a wrote:

Hi, Is there anyway in GH 0.9 to search based on explanation for a component. This will be helpful because sometimes you do not know the name of the component you are after. however, you can write few words to explain it. Any idea? Thanks

Posts: 6

Participants: 3

Read full topic

What method is used in Rhino.Geometry.Matrix.Invert?

$
0
0

@mikity_kogekoge wrote:

Hello, does anybody know what method is used in Rhino.Geometry.Matrix.Invert and in BackSolve? I’m guessing it’s a conjugate gradient method but am not sure.

Thank you.

Posts: 2

Participants: 2

Read full topic

RevSrf component not accepting vector as axis

$
0
0

@ivelin.peychev wrote:

It makes no sense to me why revolution would not accept vectors as axis of the revolution. Is this bug or it’s just being overlooked?

image

Posts: 2

Participants: 2

Read full topic

Kangaroo : Error : Unable to cast GoalObject to IGoal

$
0
0

@Antonio_Cersosimo wrote:

Hi there, recently I was learning how to use KangarooSolver.dll, I try using the examples(Dan Piker) on github but they all seem to give the same error, Error : Unable to cast “x GoalObject” to IGoal. Wearly the examples where the goal is created inside the script work perfectly but the examples where the goals are created using the kangaroo Goal Components give the error. I have no idea why the type casting fails. So I was wondering if this is common error and if there’s any solution. Thanks

IGoal Error.gh (15.0 KB)

Posts: 5

Participants: 3

Read full topic

Deforming geometry with vector

$
0
0

@alessio.maurizi1990 wrote:

Hello,

I have been studying some of the projects of Peter Eisenman and I have been trying to replicate his design process with Grasshopper.

He usually creates a simple geometric shape or grid and then applies a series of deformations to this. I’ve read that for deformation they apply vector forces and morphing to the shape.

When they developed the project above I noted that it is highly unlikely that they used Grasshopper because if I’m not wrong the project was made in 1996; however, I think that the process could most likely be replicated with Grasshopper.

For this reason, I had been looking at the vector fields components to enter in the mentality of vectors deformation, but now I’m less sure that with this method would make it possible to deform a shape.

In conclusion, I was hoping to kindly ask what kind of process or strategies could be studied in order to replicate the process of deformation used in the project above with the Grasshopper tools.

I thank you for your time and look forward to your response.

Posts: 2

Participants: 2

Read full topic

Merge Data Tree Branches

$
0
0

@medequ wrote:

Hey everyone,
this might be an easy one (maybe with the PathMapper component or an Expression?) I tried whatever I knew how to operate, however I have no idea what to do, so -
I have a Data Tree with 33 Branches (each of those contains a varying amount of lines). Now I want to merge the Branches so that there are only 11. They won’t be the same size, since the amount of lines varies. I really only want it likes this:
{0}, {1}, {2} => {0}
{3}, {4}, {5} => {1}

{30}, {31}, {32} => {10}

It would need to be correct not only for this combination, so I can use it for different situations like for from 66 to 11 Branches or 120 to 6 Branches… My problem is that I cannot flatten the original Data Tree without losing the structure… Thanks in advance :slight_smile:

Posts: 3

Participants: 2

Read full topic

Extrusion fails to go in the right vector | HELP


Create spline from coordinate data output from digitizer

$
0
0

@HisashiIMAI wrote:

Hi!!!
I’m Hisashi from Japan.

I’m trying to Create a Spline Curve from coordinate data output from digitizer.

I got the following data from the digitizer.
The data contained coordinate values ​​and some words.
・NAME/C → This is unnecessary.
・PIN → This is crease of curve.
・TAN → This is end of curve.
point_to_spline.txt (2.0 KB)

I want to organize the data and draw the correct spline curve.
But I don’t know how to organize PIN and TAN…
I need advice.

Create_Spline.3dm (30.0 KB)
Create_Spline.gh (10.0 KB)

Thank you.

Posts: 5

Participants: 2

Read full topic

Creating amphitheatre steps

$
0
0

@cokerone1214 wrote:

Hello guys!

I try to make an amphitheatre so I started to make a definition. However, I have a query. I divide 2 curves and i created a number of lines between them so now I want to create some steps but when i try to loft the curves I take a single surface. So I would like to know how can I create separate surfaces from lines in order to extrude them to create boxes. I tried to split the surface with the lines I have but I take an error.

Thanks in advance!

amphitheater.gh (21.1 KB)

Posts: 3

Participants: 2

Read full topic

How to Code in C# to detect the last operation in grasshopper

$
0
0

@lmnoc1 wrote:

Is there a way to code in C# like,

if (I just changed the name of a function) {
Now disconnect all the output lines from this function;
}

or something like,

if (the last operation in grasshopper is CURVE) {
I’ll update how many curve functions are present in current grasshopper page;
}

Hope I described it clear, I hope to find a attribute in C# to detect the last operation in grasshopper, so that can help me to create some kind of work flow.
Thanks

Posts: 5

Participants: 2

Read full topic

Automatic minimum radius correction

$
0
0

@abrahamwechter wrote:

Is there any way Rhino6 can automatically detect the minimum radius for a curve and correct it to fit a tolerance? See illustration below. This would be a huge time saver for drawing things that have to be machined with a cutter that has a limited minimum diameter. I can compensate for this when I generate a toolpath in CAM but I am looking for a way to do this to the drawing.

Posts: 8

Participants: 3

Read full topic

Reading Textures relation to Mesh (Mapping)

$
0
0

@lesan wrote:

Hey guys,

I have a Mesh that I’ve drawn on in Paint3D, now I want to read the Texture in relation to the Mesh. So that I’ll get the Texture and the unrolled Mesh on top of it.

In the end I’m interested in the brightness on certain parts of the Mesh.

It that possible? I just want to read the mapping information.

Posts: 1

Participants: 1

Read full topic

Lunchbox - non uniform hexagon cells grid

$
0
0

@p.silvaramos.95 wrote:

Hello everyone!

I’m trying to create a hexagonal pattern on an irregular surface and I’m using lunchbox’s hexagon cells component. However, in order to obtain the result I want, I need the values in the v direction to decrease along the surface. I’ve tried different things, but nothing seems to work. Does anyone have an idea on how to solve this?

Thank you!

Projecto Tese.gh (62.5 KB)
Projecto Tese.3dm (520.4 KB)

Posts: 1

Participants: 1

Read full topic

Trim with BREP inconsistent output


Web Front End for using Grasshopper

$
0
0

@diplanbits wrote:

Dear all,
I am new to the GH world and although I scanned the forum I couldn´t find a solution yet to this:

  1. I want to have a friendly User Interface on our homepage to enter the data we need for GH
  2. this should be transmitted in real time to GH on a cloud service (ideally via Excel data entry mode).
  3. Grashopper should then be connected (in the cloud) to Dynamo for the visualization ( evtl. with specklr)
  4. Data renderings should run in the cloud and results shall be displayed in the User Interface again.

The idea is to have a solution for non GH & Dynamo savvy people who need a first quick analysis.

Any ideas on this?

Best, Charly

Posts: 2

Participants: 2

Read full topic

"Select folder" window style change (C#)

$
0
0

@Petrik_Kollar wrote:

Hello,
I’ve found a C# script which allows to select folder, and save the panel content into a folder as .txt
Unfortunately i don’t know coding. Is it possible to change the folder selection window to this
style

insted of this 2

Here is the code

using Rhino;
using Rhino.Geometry;
using Rhino.DocObjects;
using Rhino.Collections;

using GH_IO;
using GH_IO.Serialization;
using Grasshopper;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
using Grasshopper.Kernel.Types;

using System;
using System.IO;
using System.Xml;
using System.Xml.Linq;
using System.Linq;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Collections;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Runtime.InteropServices;

///


/// This class will be instantiated on demand by the Script component.
///

public class Script_Instance : GH_ScriptInstance
{
#region Utility functions
/// Print a String to the [Out] Parameter of the Script component.
/// String to print.
private void Print(string text) { /* Implementation hidden. / }
/// Print a formatted String to the [Out] Parameter of the Script component.
/// String format.
/// Formatting parameters.
private void Print(string format, params object[] args) { /
Implementation hidden. / }
/// Print useful information about an object instance to the [Out] Parameter of the Script component.
/// Object instance to parse.
private void Reflect(object obj) { /
Implementation hidden. / }
/// Print the signatures of all the overloads of a specific method to the [Out] Parameter of the Script component.
/// Object instance to parse.
private void Reflect(object obj, string method_name) { /
Implementation hidden. */ }
#endregion

#region Members
///

Gets the current Rhino document.
private readonly RhinoDoc RhinoDocument;
/// Gets the Grasshopper document that owns this script.
private readonly GH_Document GrasshopperDocument;
/// Gets the Grasshopper script component that owns this script.
private readonly IGH_Component Component;
///
/// Gets the current iteration count. The first call to RunScript() is associated with Iteration==0.
/// Any subsequent call within the same solution will increment the Iteration count.
///

private readonly int Iteration;
#endregion

///


/// This procedure contains the user code. Input parameters are provided as regular arguments,
/// Output parameters as ref arguments. You don’t have to assign output parameters,
/// they will have a default value.
///

private void RunScript(bool select, string spNickname, ref object dir)
{

try
{
  string startupPath = Application.StartupPath;
  string folder = "";
  if (select == true) {
    using (FolderBrowserDialog dialog = new FolderBrowserDialog())
    {
      dialog.Description = "Open a folder ";
      dialog.ShowNewFolderButton = true;
      dialog.RootFolder = Environment.SpecialFolder.MyComputer;
      if(dialog.ShowDialog() == DialogResult.OK)
      {
        folder = dialog.SelectedPath;
        // set savepane
        SetSavePanel(spNickname, folder);
      }
    }
  }
}
catch (Exception)
{
  MessageBox.Show("Folder selection failed!");
}

// get path from savepanel
dir = GetFromSavePanel(spNickname);

}

//
private void SetSavePanel(string panelNickname, string path)
{
for (int i = 0; i < GrasshopperDocument.Objects.Count; i++)
{
if (GrasshopperDocument.Objects[i].ToString() == “Grasshopper.Kernel.Special.GH_Panel”)
{
Grasshopper.Kernel.Special.GH_Panel panel = (Grasshopper.Kernel.Special.GH_Panel) GrasshopperDocument.Objects[i];

    if (panel.NickName == panelNickname)
    {
      panel.SetUserText(path);
    }
  }
}

}
private string GetFromSavePanel(string panelNickname)
{
for (int i = 0; i < GrasshopperDocument.Objects.Count; i++)
{
if (GrasshopperDocument.Objects[i].ToString() == “Grasshopper.Kernel.Special.GH_Panel”)
{
Grasshopper.Kernel.Special.GH_Panel panel = (Grasshopper.Kernel.Special.GH_Panel) GrasshopperDocument.Objects[i];

    if (panel.NickName == panelNickname)
    {
      return panel.UserText;
    }
  }
}
return "";

}

// </Custom additional code>
}

Thank you

Posts: 2

Participants: 2

Read full topic

Arrange list

Asign boolean values to the list on a given items

Problem dividing Trimmed Surfaces

$
0
0

@danielhorta wrote:

Hi guys, I’m having a lot of trouble to achieve that result. I was able to make the panels but know I want to make those little bump wave patterns inside.

I actually don’t know the best approach for this. I was trying to subdivide the little surfaces, but they keep the radial subdivide scheme of the spheres. I know this has to do with the trimmed surface problem.

Anyway, do you guys have some idea?

Cheers,
Daniel

Personal Diffuser.gh (25.0 KB)

Posts: 1

Participants: 1

Read full topic

Viewing all 40128 articles
Browse latest View live


Latest Images