Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all 8530 articles
Browse latest View live

VB.NET plugin migration to Rhino 6

$
0
0

@fabiopasquarell wrote:

Hi,
just installed Rhino 6 and tried recompiling and running a big and very important plugin I wrote in VB.NET with Rhinocommon (new reference to the rhinocommon.dll in Rhino 6 folder).
The behaviour is different, something goes wrong and I can’t apparently stop at breakpoints using Visual Studio…
Any ideas? Is there a VB.NET migrating guide as the one you provided for C/C++? (http://developer.rhino3d.com/guides/cpp/migrate-your-plugin-manual-windows/)
I need to set the plugin up and running on Rhino 6 as soon as I can :-/
Cheers
f

Posts: 1

Participants: 1

Read full topic


Enable/Disable clipping planes

$
0
0

@n.leguina wrote:

Hi

I’m fairly new to coding in rhino

I am trying to control the views which are affected by clipping planes from withing a GH file in the c# component.

I can seem to access the enable pat of the clipping plane.
I don’t know where to call it from

it seems to live in the display pipeline

Here

but when I try this:

Rhino.DocObjects.ObjRef obj = new Rhino.DocObjects.ObjRef(id);
Rhino.DocObjects.ClippingPlaneObject cpObj = obj.Object() as Rhino.DocObjects.ClippingPlaneObject;
 Rhino.Display.DisplayPipeline.EnableClippingPlanes(true);

it throws this error:

  1. Error (CS0120): An object reference is required for the non-static field, method, or property ‘Rhino.Display.DisplayPipeline.EnableClippingPlanes(bool)’ (line 80)

if I try to add the clipping plane inside the parenthesis next to the true it tells me it only takes one argument

I don’t know how to access the enable in side the plane

Any help would be much appreciated

Thanks in advance

Posts: 1

Participants: 1

Read full topic

V6 Will not let me Delete a Mesh Face

$
0
0

@eric.martin wrote:

I dont know if its because I just did an update but I can not use the command delete mesh face. It just comes back with unable to delete mesh face. I am using version- Rhino 6 SR2 2018-2-20 (Rhino 6, 6.2.18051.9541)

Maybe I should go back to the other version? I thought the beta testing was done that’s why i payed to upgrade. Is this the right place to report this? The file was too big to attach so i stuck in google drive. Thanks for your time!

https://drive.google.com/open?id=1kllThF6CRYiLKB48g1rqD1FXPcH-_KJI

Edit: I just tried a different file and I can delete them fine. Any idea why I cant with this file? I can in Rhino 5 so I guess ill have to use rhino 5 for this model unless one of you experts can figure it out :slight_smile:

Posts: 3

Participants: 2

Read full topic

Obj string to valid mesh

$
0
0

@visiado.al.ordenador wrote:

Hi to all,

I make a mesh to obj function (Get an obj object from mesh) but now I was trying to re convert it to mesh but the problem is that the mesh created is not valid and the function ‘IsValidWithLog’ give me: “ON_Mesh.m_F[0] has degenerate double precision vertex locations.\n”

string[] objFile = Regex.Split(s, "\r\n|\r|\n");
            Mesh ms = new Mesh();
            System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
            customCulture.NumberFormat.NumberDecimalSeparator = ".";
            System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
            foreach (string line in objFile)
            {

                string[] sLine = line.Split(' ');
                switch (sLine[0])
                {
                    case "v": //Vertices
                        ms.Vertices.Add(float.Parse(sLine[1]), float.Parse(sLine[2]), float.Parse(sLine[3]));
                        break;
                    case "vt": //TextureCoordinates
                        ms.TextureCoordinates.Add(float.Parse(sLine[1]), float.Parse(sLine[2]));
                        break;
                    case "vn": //Normals
                        ms.Normals.Add(float.Parse(sLine[1]), float.Parse(sLine[2]), float.Parse(sLine[3]));
                        break;
                    case "f": //Faces
                        if (sLine.Length == 4) //triangle
                        {
                            ms.Faces.AddFace(int.Parse(sLine[1].Split('/')[0]), int.Parse(sLine[2].Split('/')[0]), int.Parse(sLine[3].Split('/')[0]));
                        }
                        else //quadrat
                        {
                            ms.Faces.AddFace(int.Parse(sLine[1].Split('/')[0]), int.Parse(sLine[2].Split('/')[0]), int.Parse(sLine[3].Split('/')[0]), int.Parse(sLine[4].Split('/')[0]));
                        }
                        break;
                    case "#fn": //FaceNormals
                        ms.FaceNormals.AddFaceNormal(float.Parse(sLine[1]), float.Parse(sLine[2]), float.Parse(sLine[3]));
                        break;
                    /*case "#tv": //TopologyVertices
                        ms.TopologyVertices. //.AddFaceNormal(float.Parse(sLine[1]), float.Parse(sLine[2]), float.Parse(sLine[3]));
                        break;*/
                }
            }
            var l = ms.IsValidWithLog(out string log);
            doc.Objects.AddMesh(ms);
            doc.Views.Redraw();

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Colouring the background of a EtoCollapsibleSectionHolder

$
0
0

@alonso.rosado wrote:

Hi there!

I’ve been messing around with the EtoCollapsibleSection, from the Rhino.UI namespace in Rhinocommon, in order to create some custom panel. The thing is, even though I’ve tried setting it and every inner component to a custom background colour, it still seems to be bent on remaining white in the part corresponding to the divider, the localize string pair and the “collapse/reveal” button. It would seem to be the part corresponding to the EtoCollapsibleSectionHolder, but I set that one too…

Is there any way in which I could get to colour these without making my own control from the ground up?

I attach an image with the result of what I’ve tried so far…
imagen

Edit: It would be nice to change the background of the drop down menu as well…

Posts: 4

Participants: 2

Read full topic

Function for creating a planar curve between two other planar curves

[solved]Visual studio couldn't find "Microsoft.csharp.core.targets"

$
0
0

@shaunwu25 wrote:

Dear all,

I’m currently using visual studio community 2017 with grasshoper assembly v6 and rhino common template v6 for rhino 5.

Once I try to create a new project, vs pop out an error window indicating couldn’t find “Microsoft.csharp.core.targets”.

2018-2-25%20%E4%B8%8B%E5%8D%88%2006-32-21

Is it possible it was caused by the incompatible version for rhino5?

Best regards,
Shaun

Posts: 3

Participants: 2

Read full topic

C# Parallel ForEach

$
0
0

@n.rawitscher954 wrote:

Hi guys,

I am running in to a little trouble trying to parallelise a foreach loop. I get an error at line 0, meaning that there must be something wrong in the way I am using it and is causing one of the namespaces to bug out. But I cant seem to figure out what might be wrong inisde the parallel loop. Any suggestions will be appreciated.

Here is the parallel function, and attached the gh_file

  System.Threading.Tasks.Parallel.ForEach(walkerList, (Walker w) =>
    {


    if (w.Stuck(growthList))
    {
      growthList.Add(w.Display());
    }

    else
    {

      w.Update();
      walkerLocList.Add(new GH_Point(w.Display()));
    }



    });

18_02_
25_DLA_Parallel.gh
(17.9 KB)

Thank you!

Nicholas

Posts: 2

Participants: 2

Read full topic


Using Rhino.Runtime.Skin virtual methods to set AppearanceSettings

$
0
0

@chris.rafuse wrote:

Hi All,

I’m trying to wrap the Rhino executable so it appears to be my own application. To that end, I’m trying to show/hide menu items and change AppearanceSettings.

I’ve followed the steps to creating a custom skin Creating A Skin and it appears that the app loads the .rhs file (the splash screen is gone, and the app has an open filehandle to the .rhs file).

I’ve overriden OnEndLoadAtStartPlugIns and ShowSplash and have the following code in both:

.RhinoApp.Write(“Hellow World!”);
Rhino.ApplicationSettings.AppearanceSettings.MenuVisible = false;
Rhino.ApplicationSettings.AppearanceSettings.CommandPromptBackgroundColor = System.Drawing.Color.Yellow;

However, none of these calls are visible in the running application. What am I missing ?

Posts: 4

Participants: 3

Read full topic

IronPython - Abstract Syntax Tree

$
0
0

@onrender wrote:

Hi,

I would like to convert a string that looks like a list into a real list.

I have found implementation for this by using import ast, however the module is not supported in Rhino 5.

import ast

list = "[1,2,3]"

ast.literal_eval(list)

Can anyone recommend an alternative for this conversion?

Posts: 5

Participants: 4

Read full topic

[v6] No colors for Point Clouds?

Wish: Quaternion arithmetics and applying rotations other than via Transform?

$
0
0

@RIL wrote:

I’ve been looking into quaternions a bit and tried to use the Rhino Quaternion class, and I’m not claiming that I have grasped the quaternions concept in full, but it seems that Rhino Quaternions doesn’t support rotating other Rhino classes directly, like transform does.

Although Rhino quaternions supports arithmetics with other quaternions, it seems that the only way to apply rotations to other classes is via rotations retreived from the quaternins as Angle-Axis values or by quaternions yielding rotated Planes after some pure q (only) arithmethics (or by creating Transform from those results).

For example, I have noticed that in plethora of documentation for quanternions out there, there’s often assumed that multiplication (rotation) of quaternions with vectors can be done directly with quaternions, i.e. “v1 = q * v”. It simplifies life if one can use “std formulae” as documented in scientific papers etc.

Q: Also, is there any chance that extended support for quaternions arithmetics be added to the RhinoCommon Quaternion class, as well as a few more “essential” methods like;

  • Vector3d Quaternion.eulerAngles; // all three angles
  • static Quaternion Quaternion.Euler(double anglex, double angley, double anglez);
  • void Quaternion.SetFromToRotation(Vector3d fromDirection, Vector3d toDirection);
  • static Quaternion.LookRotation(Vector3d forward, Vector3d upwards = Plane.WorldXY.ZAxis);
  • static Quaternion.RotateTowards(Quaternion from, Quaternion to, double maxDegreesDelta);
  • static Quaternion.Lerp(Quaternion a, Quaternion b, double t);
  • static Quaternion.Slerp(Quaternion a, Quaternion b, double t);

Well, any compentent game engine provides these (above examples from Unity).

And in addition to arithmetic “compatibility” with other relevant Rhino classes, perhaps some overload equivalents yielding Transforms for relevant similar quaternion operations.

That would be gold.

Problem is that quaternions are not the kind of thing that you deal with intuitively, math abstractyions as they are, therefore it’s easy to forget the reasoning about them from time to time. I guess this is why you pad classes with methods hidning complex reasoning.

May I humbly suggest adding this to Rhino 6.4? :wink:

// Rolf

Posts: 1

Participants: 1

Read full topic

Python user interface

$
0
0

@onrender wrote:

Hi there,

I have number of simple question regarding Python GUIs

What I currently know about Eto is that Eto is a framework that can be used for user interface design for Rhino6 for both Mac and Windows.

Can I use Eto for websites?
Is Eto specifically designed for Rhino 6 only?
What is the reason Eto is not implemented for Rhino 5?
What is the difference between tkinter and Eto?
Why Tkinter does not work with Rhino?

Thanks,
Andras

Posts: 2

Participants: 2

Read full topic

Rhino python

$
0
0

@levanhieu12302 wrote:

hi everyone, i know a bit about python. How can I create a script or create a plugin using python? Give me some samples or detailed documents! or video

Posts: 2

Participants: 2

Read full topic

Curve.Contains Method too slow

$
0
0

@D-W wrote:

I’d like to check if points are in curve but existing implementation is too slow for me any ideas for workarounds here? For 4k pts and 100 crvs it takes ~1sec on a quite decent machine ~70% of time it checks if point is in or out and i have to live update screen during the change of parameters influencing size of crv for eg. - so it gives me one frame per sec while 4k pts is rather small amount in my case…

Posts: 1

Participants: 1

Read full topic


Is it possible to load a toolbar and plug-in remotely?

$
0
0

@DanBayn wrote:

Is there a way to remotely load a toolbar and plug-in in a new Rhino 6 install? I’ve been able to control almost everything else through a batch file, but these two items still require interaction.

Also, the new advanced settings are another area it would be advantageous to be able to manipulate remotely. Is that possible? For example, take Toolbars.TabHeightPadding and change the value from 0 to 2.

I was hoping that was controlled in one of the settings XML files, but it doesn’t appear to be the case.

Thanks,

Dan

Posts: 3

Participants: 2

Read full topic

RC: Create a boundary curve

$
0
0

@Dmitriy wrote:

Hi,
I am looking for a way to create a “boundary” curve from collection of curves.
In a manual way I can use CurveBooleanUnion command and pick all regions, but how to do it in RC just by having a collection of different curves (closed and non-closed).
Example is enclosed.

CurveBoolean.pdf (2.9 KB)
CurveBooleanUnion.3dm (45.6 KB)

Thanks in advance,
Dmitriy

Posts: 3

Participants: 2

Read full topic

Offset closed polygon to inside

$
0
0

@Christoph1 wrote:

Dear all,
I’m trying to offset a (convex) quadrilateral to the inside. But for some reasons, two of the four offset points are not where they should be, as can be seen in the image:

What am I missing?

Attached is also the script:

    internal static double[][] PtsFromOffsetRectangle(List<Point3d>plist, double offsetdistance)
    {
        double[][] ptz = new double[4][];
        for (int i = 0; i < 4; i++)
        {
            ptz[i] = new double[2];
            ptz[i][0] = plist[i].X;
            ptz[i][1] = plist[i].Y;
        }

        double[] dblcen = Misc.Centroid(ptz);
        Point3d cen = new Point3d(dblcen[0], dblcen[1], 0);
        PolylineCurve crv = new PolylineCurve(plist);
        Curve[] offsetcr = crv.Offset(cen, Vector3d.ZAxis, offsetdistance,0.1, CurveOffsetCornerStyle.None);
        PolylineCurve offsetpl = offsetcr[0].ToPolyline(0, 0, 0,System.Double.MaxValue, 0, 0.01, 0, 0,true);
        Point3d offsetpt0 = offsetpl.Point(0);
        Point3d offsetpt1 = offsetpl.Point(1);
        Point3d offsetpt2 = offsetpl.Point(2);
        Point3d offsetpt3 = offsetpl.Point(3);

        return new double[][] { 
            new double[] {offsetpt0.X, offsetpt0.Y }, 
            new double[] {offsetpt1.X, offsetpt1.Y },
            new double[] {offsetpt2.X, offsetpt2.Y}, 
            new double[] {offsetpt3.X, offsetpt3.Y}};
    }

Many thanks,
Christoph

Posts: 1

Participants: 1

Read full topic

GH - C# weird behaviour - as always i missed something

UDK : Comment sont levés les "Mappable keys"

$
0
0

@icecreamkb01 wrote:

Bonjour à tous
Alors voilà, quelqu’un saurait-il comment sont levé les évènements des touches appuyées pour UDK?

Nous voudrions pouvoir utiliser un nouveau périphérique autre que la souris, le clavier … : En l’occurrence la Kinect.
Nous avons développé notre API qui permet d’exploiter la kinect en c++.
Nous l’avons intégré dans UDK en unrealscript, cependant on voudrait pouvoir lever un évènement lorsque l’on détecte un geste.
On voudrait donc faire le binding de nos geste avec une commande UDK et réussir à lever nos évènements qui exécuterons les commandes prédéfinis.

Par exemple :
Bindings=(Name=“BrasEnAvant”,Command=“StartFire | onrelease StopFire”)
Comment lever l’évènement “BrasEnAvant” ?

Merci d’avance

Posts: 4

Participants: 4

Read full topic

Viewing all 8530 articles
Browse latest View live