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

Vray/ Rhino Rendering in Grasshopper

$
0
0

@zain.koita wrote:

Hello everybody,
I have modeled a sphere like shape with hexagonal apertures that changes size based on an attractor.
I wanted to animate this using Vray or rhino render. I looked at Giulio Piacentino’s script that was later updated by Jacek Markusiewicz(The grasshoper file attached has all the definitions im using). However, i cant seem to connect them together to get the desired effect. I have attached a sample video that was made by animating a slider. i would also like some advice on setting up cameras to change views in gh. Please help im fairly new to grasshopper.

Hexa_Apetures.gh (25.0 KB)

https://discourse-cdn-sjc1.com/mcneel/uploads/default/original/3X/e/0/e0615afb45e438d363803d8806097df8b633dbe5.mp4 Hexapertures.3dm (11.9 MB)

Posts: 2

Participants: 2

Read full topic


Is there a way to make Galapagos work with Domains instead of sliders?

Issues building ghpython

$
0
0

@ivelin.peychev wrote:

I am trying to build ghpython with VisualStudio2017:

However I receive this error

Severity Code Description Project File Line Suppression State
Error CS0266 Cannot implicitly convert type ‘object’ to ‘System.Windows.Forms.Control’. An explicit conversion exists (are you missing a cast?) GhPython Path\ghpython\Component\ScriptingAncestorComponent.cs 586 Active
public Control CreateEditorControl(Action<string> helpCallback)
    {
      if (m_py == null) return null;
      var control = m_py.CreateTextEditorControl("", helpCallback);
      return control; //error comes up at this 'control'
    }

Posts: 2

Participants: 2

Read full topic

DrawViewportWires from IGH_PreviewData : is data selected or not?

$
0
0

@lionpeloux wrote:

Hello,

In a custom GH_Type …
GH_CDirectrix : GH_Goo<CDirectrix>, IGH_PreviewData

… I’m implementing a custom preview by overriding:
public void DrawViewportWires(GH_PreviewWireArgs args){}

How can I know If this method is called by a selected component (for instance a list item component) to customize the color of the display ?

I know how to do that within a parameter (Attributes.Selected) display but not in the type itself …

Thanks

Posts: 2

Participants: 2

Read full topic

Compiled GHPY vs GhPython

$
0
0

@ivelin.peychev wrote:

Questions:

  1. Processing-wise, which one is heavier a scripting component or compiled ghpy?
  2. Do all components become multi-threaded? (even .ghpy?)

Posts: 1

Participants: 1

Read full topic

Accessing guid (sliderguid)

Cylinder with honeycomb, necker cube tesselation

$
0
0

@patrickhartog wrote:

Hi Everybody,

I am working on a pattern that originated from a lunchbox hexagon cell tesselation. I try to mimick a kind of depth necker cube pattern that is varying in depth by an attractor point. The problem I am experiencing is that the 4 point surfaces I create with this method look pretty ok, when the depth is at it’s maximum. But when there is now depth at all, some of the surfaces look hollow and different then the other surfaces. It’s best seen when the surfaces are baked. I attached the grasshopper file.

honeycomb to necker2.gh (23.2 KB)

Does anyone know a better way to generate these surfaces?

Kind regards, Patrick

Posts: 2

Participants: 1

Read full topic

How do I make the display of a component independent of whether "Draw Icons" in Grasshopper is checked or not?

$
0
0

@ParamDesSing wrote:

How do I make the display of a component independent of whether “Draw Icons” in Grasshopper is checked or not?

I.e., I’m looking for the same behavior as, for example, Galapagos.
I’m writing my own component attributes, I just don’t know what to look out for.

Thanks!

Posts: 4

Participants: 2

Read full topic


C#_weave component

$
0
0

@obhagwat29 wrote:

I am trying to make star shape polyline using the points shown in the picture in c#.
Any help would be great!

attached image and script.

List<Point3d> Tpts = new List<Point3d>();
List<Point3d> midPts = new List<Point3d>();
List<Point3d> endPts = new List<Point3d>();
List<Point3d> strPts = new List<Point3d>();
List<Curve> star = new List<Curve>();

List<Curve> crvs = Polygon(2, 8, 22);
Curve cr = crvs[0];
List<Curve> cC = cr.DuplicateSegments().ToList();
Rhino.Geometry.AreaMassProperties cA = Rhino.Geometry.AreaMassProperties.Compute(cr);
Point3d centro = cA.Centroid;

foreach (Curve c in cC)
{
  Point3d p = c.PointAtNormalizedLength(0.5);
  Point3d p1 = c.PointAtEnd;
  Tpts.Add(p);
  endPts.Add(p1);
}

foreach(Point3d pt in endPts)
{
  Curve lines = new Line(centro, pt).ToNurbsCurve();
  Point3d mP = lines.PointAt(t);
  midPts.Add(mP);
}

//////////////////////////////////////////////////////
/* /???
for (int i = 0; i < Tpts.Count;i++)
{
strPts.Add(Tpts[i]);
strPts.Insert(i+2, midPts[i]);
}

Polyline allPls = new Polyline(strPts);

*/

weave%20pattern

Posts: 1

Participants: 1

Read full topic

How to refresh the component it self?

$
0
0

@andrealu2012 wrote:

For example,if the component listen to a event,and when the event is raised,how to refresh (disable then enable)it self?
Thank you!

Posts: 2

Participants: 2

Read full topic

Mesh Block Def -> linked Instance -> GH Mesh

$
0
0

@RIL wrote:

OK, so I ask again:

How do I - with C# - reconstruct a valid Mesh object in Grasshopper based on a linked (mesh) Block Instance from Rhino Document which was defined in another Rhino file?

So far I have gotten only so far, but I have failed to instantiate the InstanceObject (or its InstanceReferenceGeometry):

I simply cannot find a way to instantiate a copy of this indirection of a definition.

bild

Manually I can assign a GH Mesh parameter by setting the option “Mode = Copy” and pick the linked Mesh instance in Rhino, which makes the Mesh parameter internalized.
bild

But I don’t want to internalize/store a huge Mesh in the definition (takes forever to save).

I would be fine with just a runtime copy (I extract the parts I need from the mesh downstreams the GH graph anyway). But how instantiate with C#?

// Rolf

Posts: 1

Participants: 1

Read full topic

GH_Structure delete data at certain path

$
0
0

@a.ai wrote:

Hi there,

I want to access a path of a data tree, delete all data found there (a list of Type GH_Number) and append a new list (of Type GH_Number). How do I do that? I searched through the SDK and did not find a suitable method.
Was thinking about using the RemovePath method, but then I dont know if all the data associated with the path (meaning the data on higher levels) would get deleted too.

Thanks for your answers / hints!

Posts: 1

Participants: 1

Read full topic

Text Tag 3D Preview in ghpythonlib does not give text preview

$
0
0

@mattgaydon wrote:

Hi All,

Love being able to access all the GH components in Python but both Text Tag 3D and Custom Preview, run without errors but do not preview text/geo etc

import ghpythonlib.components as gh
gh.TextTag3D(Loc,Text,Size,Col,0)

Is this because the python component is overriding their preview somehow and is it possible to turn this off.

Cheers
Matt

Posts: 4

Participants: 2

Read full topic

Extracting ABC angles from Plane (Yaw Pitch Roll)

$
0
0

@nkal wrote:

Hello,

I am having trouble extracting the yaw pitch and roll from a plane. I have a c# function that does the opposite: takes in abc values and produces a plane out of them:

public Rhino.Geometry.Plane calculatePlaneFromPos(string encodedPosition)
    {

        E6Pos position = new E6Pos(encodedPosition);
        Point3d tempPoint = new Point3d(position.xValue, position.yValue, position.zValue);
        Plane tempPlane = new Plane(tempPoint, new Vector3d(0, 0, 1));
        Transform rotationZ = Transform.Rotation(Rhino.RhinoMath.ToRadians(position.aValue), new Vector3d(0, 0, 1), tempPoint);
        tempPlane.Transform(rotationZ);
        Transform rotationY = Transform.Rotation(Rhino.RhinoMath.ToRadians(position.bValue), tempPlane.YAxis, tempPoint);
        tempPlane.Transform(rotationY);
        Transform rotationX = Transform.Rotation(Rhino.RhinoMath.ToRadians(position.cValue), tempPlane.XAxis, tempPoint);
        tempPlane.Transform(rotationX);
        return tempPlane;
    }

Now I need a function that does the opposite, takes in a plane and spits out XYZ and ABCs.
As background information, I am working on a software that interacts with a KUKA robot, and the datatype used involves having XYZ and ABC to define an endpoint for the robot arm to move to.

“In kuka, rotations are done in order A > B > C where
A is rotation about Z
B is rotation about Y
C is rotation about X”

Something similar has been asked here, but the solution provided does not work for my case.

Any suggestions?

Thanks!

Posts: 4

Participants: 2

Read full topic

GHPython: Adding Volatile Data To Output Parameters (Unexpected Nulls)

$
0
0

@AndersDeleuran wrote:

Hi All,

I realise this is probably something I should be writing in a compiled component, but:

I’m fiddling about with some ideas that involves assigning data to output parameters, without assigning them as usual (that is, via the implied link between the parameter name and the variable name in the code) but instead based on their index. As far as I’ve been able to gather, this requires going through the GH_Param for the output parameter and implementing one of the methods there for adding/appending data. This appears to work somewhat, but I wonder if this is even the “correct” approach?

For instance, in this minimal example I get “strange” nulls if the GHPython components have input parameters, but things appear to work as (I) expected without any inputs:

180913_AddVolatileData_GHPython_00.gh (4.7 KB)

I’ve tried other approaches as well, such as accessing the GH_Structure of the parameter directly and calling Append, AppendRange etc, with the same result as above.

Any inputs here would be great.

Cheerio,

Anders

Posts: 2

Participants: 2

Read full topic


Origami like tesselation

$
0
0

@patrickhartog wrote:

I want to create a origami like structure on a cylinder, but without using kangaroo. I do not need to have the ability to really unfold the structure, but I do like the look of the image attached.

I really do not know how to start. Could I use lunchbox or paneling tools for this? I looks almost like it originates from a hexagon structure, but the triangles are all overlapping, so it also seems the hexagons are overlapping.

If anybody has any idea, please let me know! Thank you in advance.

Patrick

Posts: 2

Participants: 2

Read full topic

Warning while using virtual components

Surface Name

ghPython reloading modules

$
0
0

@aitorleceta wrote:

Hi,
I’am maintaining some IronPython classes from Visual Studio. I’am trying my ghpython component to be aware of changes made from VS on the modules it is importing. For this, i´am using reload() method from Standard Library, but it doesn’t work, not sure why. My code looks like this:

import inspect
import myNamespace
import myNamespace.MyModule as modul
reload(myNamespace)
reload(myNamespace.modul)
import myNamespace
import myNamespace.MyModule as myModul

attrs = [attr for attr in dir(myModul.myClass) if not inspect.ismethod(attr)]
for attr in attrs:
     print attr

When I add a new attribute to myClass in Visual Studio, I need to restart Rhino in order to ghpython detect the changes. Am I somehow missusing reload method? It seemed straightforward but I cant make it work…
Any help would be appreciated
thanks
leceta

Posts: 2

Participants: 1

Read full topic

Performance testing

$
0
0

@ivelin.peychev wrote:

Hi,

Is there a way to encapsulate different defintions in GH to see which one needs more processing?

Using clusters is not an option because they are “static”, cannot self-update.

Posts: 10

Participants: 4

Read full topic

Viewing all 3638 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>