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

Rhino Common Radial Dimension

$
0
0

@dimcic wrote:

Hi,

just a short question regarding the RadialDimension in C#. The constructors described in the Help file are not there…I am offered only an empty constructor:

image

any idea where the problem is and how to solve the creation of a Radial Dimension? (Other Dimensions are working fine…)

Thanks

Posts: 1

Participants: 1

Read full topic


Align Hatch Patterns

$
0
0

@skitsasm wrote:

Hello all,

Long time Rhino user here, not quite experienced with Python.

I am trying to work out a script that matches hatch patterns, to bypass an issue with Rhino’s own “Match Pattern” command.

Specifically: For hatches created while using various CPlanes, the rotation is stored as “Relative to the Hatch Plane”. So you can match the pattern but say if the desired rotation is 45°, every hatch will turn to 45° from the cplane in which it was created.

I haven’t been able to either modify that cplane info, or even just access it, which would allow me to at least create new hatches with the desired attributes and delete the old ones.
Is there a specific hatch class attribute that I can call? I haven’t found anything in the available documentation…

Any suggestions would be extremely appreciated,
Thanks in advance!

M

Posts: 1

Participants: 1

Read full topic

C++ Compiling error

$
0
0

@Petras_Vestartas wrote:

Hi,

When I open a new template for C++ plugin and try to compile it I get this error:

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: ‘WinSock2.h’: No such file or directory PlugIn1 C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\atlmfc\include\atldef.h 720

Before it was working fine, what could cause this issue?

Posts: 1

Participants: 1

Read full topic

Parallel Programming Problems / Overview

$
0
0

@alexander.meyer wrote:

I tried replacing some loops with Parallel.For and got some Exceptions, e.g.

Rhino.Runtime.DocumentCollectedException
Message=This object cannot be modified because it is controlled by a document.
Source=RhinoCommon
StackTrace:
at Rhino.Runtime.CommonObject.ConstPointer()
at Rhino.Geometry.Intersect.Intersection.CurveCurve(Curve curveA, Curve curveB, Double tolerance, Double overlapTolerance)

Both Curves A and B are created locally in the Parallel.For loop.

curveA = (new ObjRef(layers[k].guids[j])).Curve();
curveB = line.ToNurbsCurve();

The tolerances are both RhinoMath.ZeroTolerance.

I guess I shouldn’t use doc in parallel operations, but what about the other stuff? Is there any guide or overview what is thread-safe and what’s not?

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Bug in Curve.Offset

$
0
0

@alexander.meyer wrote:

Using the Curve.Offset command, I get the following offset curve at the transition to a sharp corner:


Bigger:
grafik

Reproducing this with _Offset or _OffsetMultiple in the GUI, everything works as expected:


Corner in question:
grafik

The code used is:

Curve[] moved_curves = curve.Offset(curve_plane, -Line_Distance * (m + 1), RhinoMath.ZeroTolerance, CurveOffsetCornerStyle.Round);

curve_plane is the plane constructed by Curve.TryGetPlane, LineDistance is a double and m is an int.

Is this a bug? Or an weird, but expected behaviour?

Posts: 3

Participants: 2

Read full topic

Dynamic Index Structure with R-Trees for Maps - C# - Python

$
0
0

@Antonio_Cersosimo wrote:

Hi, I was wondering if it is possible to use the Rhino.Geometry.R-Tree for loading only the geometry(Polygon or other) that fits in the Viewport. Lately I been messing around with country size Datasets. I’m pretty new at R-Trees so I don’t know how difficult would be to implement something similar to this video, any advice, information or examples would help. Thanks!!
https://www.youtube.com/watch?v=xsll-AMd430
R-Tree Paper = http://www-db.deis.unibo.it/courses/SI-LS/papers/Gut84.pdf
HTML Example = https://github.com/leaflet-extras/RTree

Posts: 1

Participants: 1

Read full topic

C++ Active View - SDK changed

Construction plane from closed curve profile

$
0
0

@onrender wrote:

Hi,

Can anybody help me how to create a CPlane from a closed curve in Python?
I would like to click on the profile, define the X axis of the CPlane and draw lines. After I finish the CPlane would jump back to the previous CPlane.

Posts: 1

Participants: 1

Read full topic


Is there a method for knowing if file has data from certain plugin via its GUID?

$
0
0

@D-W wrote:

As in the title. Thing is that certain plugin had its guid in v5 and for v6 plug have new guid but we’d like to remap old saved data from v5 file to v6. The whole thing is about transferring materials so @nathanletwory maybe you have a clue how to get things right? This time question relates to c++.

Posts: 1

Participants: 1

Read full topic

Split Brep / User string

$
0
0

@fthomas wrote:

Hello,

Using “RhinoBrepSplit”, is it possible to use user strings on a brep and retrieve these user strings on the resulting breps ?
I have made some tests, adding user string on both the brep and even on each ‘ON_Surface’ of it but after “RhinoBrepSplit” I never retreive any of those user strings on any resulting breps…

Kind regards,
FT

Posts: 2

Participants: 2

Read full topic

Storing custom dimension styles

$
0
0

@shehanwilfred wrote:

Hi all,

I have created a plugin for rhino and I want to add some custom dimension styles. I can create the dimension styles by navigating to Dimension -> dimension styles. I want to know how can I save the custom dimension styles permanently so that when I ship my plugin, the users who install the plugin will also get my custom dimensions.

Regards,
Wil

Posts: 1

Participants: 1

Read full topic

Rotate vector question

$
0
0

@onrender wrote:

Hi there,

I wanted to use the RotateVector method but it does not work somehow.

I would like to rotate the tangent of the curve (at the start point) by 90 degree based on the normal vector of the curve plane. Finally I have got this result:

Rotate vector.py (969 Bytes)
Rotate vector.3dm (25.7 KB)
Rotate%20vector

Posts: 1

Participants: 1

Read full topic

Can't find polygon command?

$
0
0

@Jakob1 wrote:

Hey,
This is probably (hopefully) a very simple question, but which seems to be harder to find an answer for than it should.
I would like to draw star polygons with python (GHpython), but I can’t seem to find the command for it. Whats the Rhinocommon command for creating n-sided polygons? Is the polygon tools a macro of other commands?
Many thanks
/Jakob

Posts: 3

Participants: 1

Read full topic

RhinoDoc.Objects contents and hidden objects

$
0
0

@software_comas wrote:

Hi
I’ve noticed a “strange” behaviour accessing RhinoDoc.Objects list.
Let’s say we have a document with 10 objects, 2 of them are hidden.
The RhinoDoc.Objects.Count property says i have 10 objects (of course) but if i cycle through the list using a “foreach” statement or if i try to select objects using LINQ, the “Objects” list just contains 8 objects!
Is this “normal”?
How can i get the complete list of objects?
Thanks to you all!

Sebastiano

Posts: 4

Participants: 2

Read full topic

Maths behind Plane.FitPlaneToPoints method


How to find the objects close to a point

$
0
0

@gennaro wrote:

Hi everybody!

I am looking for a way to find the closest objects to a point (with a distance under a certain threshold).
I used to have something similar in Rhino 5 defining the pick_context.m_pick_region.m_xform equal to the inverse of an Xform defining a custom rectangle. Unfortunately this method was not robust for objects crossing this rectangular area and the pick_context.m_pick_region.m_xform is private in Rhino6.
Is there a solution that allows me to have this list without iterating on all objects to find the distance from the point?
I ask it because I assume that Rhino have access to an internal spatial indexing of the objects, so I expect its functions to be faster.

Thanks
G.

Posts: 1

Participants: 1

Read full topic

Move curve's control points c#

$
0
0

@tsiddikee wrote:

Hi, Is there any sample code for moving curve control points in c# dot net ? I have a 3dm file. I will need to move start point of each curve to a new position. I have couple of thousands curves.
Any sample code will be a big help.

Many thanks in advance!

Posts: 2

Participants: 2

Read full topic

[GH/C#] Migrating bbox points

$
0
0

@D-W wrote:

Does anyone have idea how to stabilize corners of box made from bbox?

I need box created based on axis and i need its corners but since they are dancing around they are pretty useless in my case…

@dale @pascal would you mind looking on this here and maybe you have some remedy for this?

migrating_bbox_points.gh (16.7 KB)

Here’s one without kangaroo counter (besides i forgot earlier internalise points):
migrating_bbox_points_nokan.gh (16.5 KB)

Posts: 1

Participants: 1

Read full topic

Installing earlier version of Rhino6

$
0
0

@Petras_Vestartas wrote:

Is there any way to install earlier version of rhino 6 together with latest one?

The issue is following:
If you are a developer, you usually have the latest rhino version. But users may have Rhino 6.2 6.3 or 6.4 while mine is 6.8. Such add ons (grasshopper) will not load on users computers and there will be constant communication that they must update rhino.

Is the only way to install very early rhino6 on some other computer, then copy dll files to USB stick and compile it with them?

In my case it is ngon methods for meshes that did not change since first releases.

Posts: 2

Participants: 2

Read full topic

SetCommandPrompt

$
0
0

@onrender wrote:

Hi there,

I would like to create some dialog for the script that I am working on. I have checked the CommandLineOption script however I noticed that it is for the Get classes. I would like to set the dialog as the first part of the script without to select anythong.
The user could select some option Op1, Op2, Op3 and than the script would continue accordingly.

I have found the Rhino.RhinoApp.SetCommandPrompt() but it does not work. It is interesting because WriteLine() works well.

Another question. I got the message for the Rhino.RhinoApp.BuildDate() that DateTime is not callable. Is it because Python does not have this data type?

import Rhino
import scriptcontext

sc = Rhino.RhinoApp.SetCommandPrompt("message-CommandPrompt")
#Rhino.RhinoApp.BuildDate()
Rhino.RhinoApp.WriteLine("message-WriteLine")

Posts: 6

Participants: 2

Read full topic

Viewing all 8599 articles
Browse latest View live