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

Possible Curve.DivideByLength(Double, Boolean, Boolean) bug?

$
0
0

@software_comas wrote:

Rhino V6 SR13 / RhinoCommon

Let’s say I would like to divide an open curve into a fixed number of segments (i.e. 10) of the same length:

Curve workingCurve;

Double curveLength = workingCurve.GetLength();
Double segmentLength = curveLength / 9.0;

Calling

Double curveParams = workingCurve.DivideByLength(segmentLength , true, false);

I get 10 curve parameters, and that’s ok.
But if I call

Double curveParams = workingCurve.DivideByLength(segmentLength , true, true);

I get 9 curve parameters!
Is this a bug?

Posts: 1

Participants: 1

Read full topic


Layer table index vs. Layer ID

$
0
0

@Helvetosaur wrote:

While looking at layer table methods for another thread, I came across this:

However, when trying to get an object’s layer via object attributes, there is no method currently available other than using the layer index…

The above statement in the RhinoCommon api guide then seems contradictory… If it really is the direction we are going, doesn’t object attributes need an additional property LayerId ?

Posts: 1

Participants: 1

Read full topic

Extrusion Can not Set UserDictory Data ;

$
0
0

@1056960357 wrote:

Hi,
I’m have some problerm about set UserDictory data on Extrusion Object.
I want to Set an key to all of the Object when the object once add into the Rhino Document.
But I find that . Only the Extrusion could not to be set UserDictory. My C# is As Fellow:

(The Code is to set UserDictory to the object when object add to the RhinoDocument)

     private void RhinoDoc_AddRhinoObject(object sender, Rhino.DocObjects.RhinoObjectEventArgs e)
        {
            try
            {
                GeometryBase Geom = e.TheObject.Geometry;
                if (Geom is Surface)
                {
                    Geom = (Geom as Surface).ToBrep();
                }
                Geom.UserDictionary.Set("Label", "");
            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

(To View the UserDictory has setting to the Geometry)

          GeometryBase Geom = default(GeometryBase);

            if (!DA.GetData(0, ref Geom)) return;
                    
            List<string> TempOutPutString = Geom.UserDictionary.Keys.ToList();
            DA.SetDataList(0, TempOutPutString);

Thanks

Posts: 1

Participants: 1

Read full topic

Create licenced plugin from Grasshopper definition

$
0
0

@parametricmonkey1 wrote:

Hi

I have a grasshopper definition which I would like to distribute with licensing restrictions. I’m wondering what is the best way to do this. Is it possible with a GH definition or does it need to be completely transcoded into C# or Python?

This post talks a bit about password protected clusters or user objects. This solves somewhat the IP issue but doesn’t address the licensing issue. This tutorial talks about plug-ins that expire (which would somewhat address the licensing issue) but it is for C/C++ and I’m not sure how that is compatible with a GH definition.

Any guidance? Thanks

Posts: 1

Participants: 1

Read full topic

Brep.ClosestPoint method in Rhino3dmIO.Desktop Version 6.13?

$
0
0

@kermin_chok wrote:

Hi,

I have an external application that i want to find the closest point between 2 breps. Specifically, 2 surfaces defined by polylines.

As such, I’m using the Rhino3dmIO.Desktop library to leverage the opennurbs geometry library. It looks like the Brep.ClosestPoint method is not available in that library unlike the RhinoCommon library where this method is available.

Does anyone have any suggestions or directions for how to perform the same check (closest point check) using the Rhino3dmIO.Desktop sdk?

Thanks.

Posts: 1

Participants: 1

Read full topic

Is it possible to embed Rhino viewport in Winform or WPF?

$
0
0

@mklee wrote:

Hello. I have some question about embedding rhino viewport in .NET develop environment.

I searched some code about that, such as ‘rhinocommon’ and ‘rhino inside’, but I think this is just for use plug in in Rhino.

Is it possible to embedding rhino viewport and using rhino’s function in winform develop environment? (for example, make surface)

Posts: 1

Participants: 1

Read full topic

Empty guid returned from BooleanDifference

$
0
0

@Goswin wrote:

Sometimes rs.BooleanDifference(keep,cut)
returns an empty Guid and still adds a new Brep to the document.

Is this a bug in Rhinocommon?

Rhino 6 SR13 2019-2-27 (Rhino 6, 6.13.19058.371, Git hash:master @ 17cd8b51accbe17dd04b48028f49d5e77a67f17b)

Posts: 1

Participants: 1

Read full topic

TextEntity, Get Font of the text


File3dm.ReadRevisionHistory createdOn

$
0
0

@mswaidan wrote:

I’m working on a plugin to help our support staff gather info from Rhino users when they’re having an issue. I can’t get the createdOn field in the File3dm.ReadRevisionHistory to return a meaningful value.

I see from the docs that createdOn returns DateTime.MinValue if not set in file. Regardless of what file I open, who created it, where it was created, I consistently get DateTime.MinValue for createdOn. All the other fields return the expected values. Is this a bug, or am I missing something?

I think I can grab this info from System.IO.FileInfo instead, but am curious why the Rhino method isn’t working for me.

Posts: 1

Participants: 1

Read full topic

How to use skin

How to run rhino cmmands in plugins

Exporting Multiple Block Definitions

$
0
0

@Darryl_Menezes wrote:

Hi,
Is it possible to export multiple block definitions at once in Rhinocommon? Just like it is done in block manager as shown in below picture

I have tried this using RhinoApp.RunScript(), but then I can only export one block at a time, and have to repeatedly provide block names as seen below

BlockExportMacro

This works, but is relatively slow compared to the first approach.

Posts: 1

Participants: 1

Read full topic

Does Rhino has any plugin or api to upload and import image direct to editor

$
0
0

@adriatikgashiad wrote:

I want to make a mobile app that can push files (images) directly to Rhino using any api or plugin

So my question is : Does Rhino offers any http rest api or something like this, that I can call and push files directly to Rhino and accepting files on Rhino using any plugin or anything else.

Or should I upload files somewhere else for example Google Drive and than make a plugin in Rhino and download files from Google Drive.

thanks !

Posts: 1

Participants: 1

Read full topic

Using Rhino3dmIO Nuget package, looking for c# dotnet example

$
0
0

@tsiddikee wrote:

I need to read some surfaces from 3dm file to other software.
The application I am developing is in c# dot net.
I saw some openNurbs examples in github. But at this moment in tight schedule, will be a very big help, if some one help me to find c# dotnet example for reading surfaces from 3dm file and write back into external software.

Any c# dot net example using Rhino3dmIO for reading and writing rhino objects, will be a big help.

Many thanks in advance !
TH

Posts: 1

Participants: 1

Read full topic

Copy & Paste on https://developer.rhino3d.com

$
0
0

@siemen wrote:

These 3 pages have nearly identical content:



Posts: 1

Participants: 1

Read full topic


Running the mesh example

$
0
0

@robe5177 wrote:

Believe I installed the rhinocompute items, then went into python 3.7 (anaconda prompt) and installed tkinter (import tkinter) and the tkinter._test() worked.
Running the mesh example indicated no module named Tkinter, so changed all instances in the file to tkinter, but kept the top=tkinter.Tk() (line 9).
Then ran and issues seemed ot be in line 26… per screen shot.
Does auth token get pasted into line 13 between the quotes?

Posts: 1

Participants: 1

Read full topic

Get selected named views

$
0
0

@maito78 wrote:

Hi all,

I am new in the forum and i am trying to make some scripts.

I am trying to get the selected named view from the side panel in C#, in a similar way that is possible to do for the layers with the method RhinoDoc.ActiveDoc.Layers.GetSelected().
I think this method is not implemented for the named Views. Are there other ways to achieve this? Is it possible to have access to what happens in the namedView panel?

Thanks for the help

Posts: 2

Participants: 2

Read full topic

Add Texture /C++

$
0
0

@tll4568523 wrote:

Hi
I am trying to put ON_texture(picture i want ) into ON_Material.
I found an example online that where c++/RDK/ Textures and Mappings.The code used

ON_Texture tex;
tex.m_filename = L"full path to your texture.jpg/bmp/…";

but i didn’t find ‘m_filename’ this code.
so i use

tex.m_image_file_reference.CreateFromFullPath(L"my path", 1, 1);

to repace it.but it don’t work .When i put it into my material use: material.AddTexture(tex);
there were appear a black with nothing picture.

How can I add picture into Rhino?
Is my understanding wrong? texture is under material.
Or there have other way to put my own picture into rhino attribute to become my material or decals or anything.

Posts: 2

Participants: 2

Read full topic

UV mapping

$
0
0

@Alberto wrote:

Hi All,
I am still having problems with our custom UV unwrapping method. I have the following issues that I cannot solve:

  • Surface UV mapping, I cannot assign a custom mapping to a surface (and before that retrieve the current render mesh)
  • UV editor mesh, is there a way to understand the 2D unwrapped mesh to which original mesh is connected?
  • Whenever I assign my UVs to a mesh, if the object already had UVs my custom UVs are overridden. It seems to me that there is some sort of a cache that is used instead of the mesh geometry’s UVs.

any ideas?

Thanks a lot,
Alberto

Posts: 1

Participants: 1

Read full topic

Set Background Gradient Colors from Python Rhinocommon

$
0
0

@ksteinfeld wrote:

Hello, and thanks for any assistance.
I’m trying to set the colors of the two-color gradient background of a Rhino model from a Python component in Grasshopper. I’ve managed to change the fill mode to Gradient2Color, but do not see how to access/set the colors of the gradient. Simplified code below. Any guidance is much appreciated.

mode = Rhino.Display.DisplayModeDescription.GetDisplayMode(id)
mode.DisplayAttributes.FillMode = Rhino.Display.DisplayPipelineAttributes.FrameBufferFillMode.Gradient2Color
Rhino.Display.DisplayModeDescription.UpdateDisplayMode(mode)

Posts: 1

Participants: 1

Read full topic

Viewing all 8555 articles
Browse latest View live