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

DynamicDraw conduit, how to set clipping bounds?

$
0
0

@clement wrote:

Hi @stevebaer,

i have a very simple Rhino.Display.CustomDisplay conduit which shows an axis widget, it consists of 3 colored lines. This conduit is not “dynamic”.

While this CustomDisplay runs, i am prompting the user with a simple GetPoint operation for a new location of the axis widget. The point getter draws an axis widget (with arrows) using a DynamicDraw at the mouse position while prompting for a new point which is the new origin of the axis widget. In V6 i get this:

In case you cannot view the video: ConduitClippingProblem.zip (1.2 MB)

It looks like, the DynamicDraw is using the clipping bounds of the CustomDisplay conduit. This is not related to the ground plane setting. Is there a way to tell the DynamicDraw of my point getter that it should not clip at all ?

_
c.

Posts: 1

Participants: 1

Read full topic


Checking source archive property of an InstanceDefinitionGeometry in a File3dm object

$
0
0

@Darryl_Menezes wrote:

Hi,
I want to check if an InstanceDefinitonGeometry in a File3dm object is linked to any external file or not, and if at all it is, then get the path of the external file. Is there a way to do this?
For example, InstanceDefinition class has a property called InstanceDefinition.SourceArchive, but there is no such property for InstanceDefinitionGeometry.
Thanks.

Posts: 1

Participants: 1

Read full topic

Tow dimensional data table from tree branches?

$
0
0

@flokart wrote:

Hi all,
i wrote a script with the use of xls read and write modul to handle excel data.
To show all branches (column from the xls file) i get a loooooong list with different branches in a vertical panel.
Is it possible to switch the panel from vertical to horizontal view ?
At the moment i tried pretty table python modul but maybe there is another option to show the data in a 2d grid.

This would be the goal


instead of this
Unbenannt

Posts: 2

Participants: 2

Read full topic

Event for rendercontent selected

$
0
0

@marton.parlagh wrote:

Is there an event I could connect to when a RenderContent (for example an Environment object) was selected or lost selection in the Environment Panel (same for Materials with Material panel)?

Or is it possible to check in any other way when my Eto collapsible section should be updated?

I would like to add my own control section (eto) to the Material/Environmnet panel, and I can not find anything which triggers when I change the selection.
The same with the Eto form, I overwrote the onShown/ResumeLayout/onLoad etc funcs, but these are called only at the beginning.

Thanks!
Márton

Posts: 1

Participants: 1

Read full topic

Culling duplicate points problem

$
0
0

@roger wrote:

I can’t get my head around the following problem:

I have a polysurface. I intersect a couple of planes on world z-axis to get curves on the polysurface. I then want to divide each curve by length. However, since sometimes two lines have the same start/end points, I used this code* which works fine sorting

        for (int i = 0; i < tempPoints.Count - 1; i++)
        {
            Point3d pt0 = tempPoints[i];
            Point3d pt1 = tempPoints[i + 1];
            double dist = pt0.DistanceTo(pt1);
            if (dist > this.Doc.ModelAbsoluteTolerance)
                pointsPerLevel.Add(tempPoints[i]);
        }

tempPoints are all points, pointsPerLevel should be the culled list of unique points.
However, I get this as a result:

As you can see, on some curves some points get culled while one similiar curves, they don’t. Also, the end points should be included as they are at the correct distance from the last point.
Removing above code, I get the correct points but also duplicate points at the start/end of curves.

Ignore every second line, I’m not dividing them currently.

original code altered: Delete duplicate points on Nurbs curve

Posts: 1

Participants: 1

Read full topic

Copy xls files manipulate it and save it without loosing referenced cells

$
0
0

@flokart wrote:

hi all,
i use xlwt xlrd and xlutils to read and write xls files and feed it with data in between but unfortunatly xlutils.copy dont copy all formula references instead only the value is copied.
Is there another option to copy and manipulate xls data without loosing reference paths in the formula?
openpyxl give me all time the error (works not so good with ironpython?).
Any tip is very welcome

Posts: 6

Participants: 2

Read full topic

C#_Curve.Split Mathod_Unnecessary multiple Curve splits

$
0
0

@obhagwat29 wrote:

Hello,
I am using curve.Split method(IE t) method to split closed curve into 2 segments… List “t” contains only 2 parameters when i call that method it is giving me 3 splits instead of 2 splits.

It would be a great help if anyone can tell me where I am going wrong.

here is the code. Also find attached Rhino and GH_file

List<double> t = new List<double>();

//Input for this method has to be List for further process.
splitCrvs = SplitBoundaries(bdCrv, paths, out t);
tParams = t;

//////////////////////////////
public List SplitBoundaries(List boundaries, List paths, out List tP)
{
List newBoundary = new List();

List<double> tPara = new List<double>();

for(int i = 0; i < boundaries.Count; i++)
{
  Curve cB = boundaries[i];
  Curve[] cS = null;

  if(cB.IsClosed){

    cB.Domain = new Interval(0, 1);

    for(int j = 0; j < paths.Count; j++)
    {
      Curve cP = paths[j];
      cP.Domain = new Interval(0, 1);

      double t1,t2;

      Point3d cP_Start = cP.PointAtStart; Point3d cP_End = cP.PointAtEnd;

      cB.ClosestPoint(cP_Start, out t1);
      cB.ClosestPoint(cP_End, out t2);

      Point3d p1 = cB.PointAt(t1); Point3d p2 = cB.PointAt(t2);

      double dist_t1 = cP_Start.DistanceTo(p1);
      double dist_t2 = cP_End.DistanceTo(p2);

      if(dist_t1 < 0.1 && dist_t2 < 0.1)
      {
        tPara.Add(t1); tPara.Add(t2);
        break;
      }
    }
    cS = cB.Split(tPara);

    if(cS != null)
       newBoundary.AddRange(cS);
  }
}
tP = tPara;
return newBoundary;

}
/////////////////////////////////


SplitMethod.3dm (305.4 KB)
SplitMethod.gh (7.5 KB)

Posts: 2

Participants: 2

Read full topic

c#_Curve inside Close Curve_RegionContainment

$
0
0

@obhagwat29 wrote:

Hi,
I am trying to check if the curve is inside closed curve. However bool value is always coming false.
Any help is appreciated. Attached code and picture below

bool inside = false;

var gc = Rhino.Geometry.RegionContainment.BInsideA; //or AinsideB , its always false

if(Curve.PlanarClosedCurveRelationship(iBd, iPath, Plane.WorldXY, 0.01) == gc)
{
  inside = true;
}

A = inside;

Posts: 1

Participants: 1

Read full topic


Concave specular reflections

$
0
0

@Arthur wrote:

Hi all,

I’m looking for a way to find the entire region of a curved surface that reflects specularly between an emitter and a receiver.

Quick explanation:
I have an image source algorithm that I use for planar reflection finding. The source is mirrored over a surface, and the line between the mirror image and the receiver is found. If the line intersects the piece of geometry that was used to mirror the source, then we have found a valid specular reflection.

In order to do this for a curved surface, it isn’t enough (for my application) to use the faceted mesh that backs up a curved surface. I need to find the entire region that reflects specularly, and integrate over it. I have a thought on how I can approximate it, using some special edge querying and Delaunay triangulation, but I was wondering if anyone out there had a better idea…

Let me know. Thanks!

Arthur

Posts: 1

Participants: 1

Read full topic

RhinoCommon compatible with .NET core framework

$
0
0

@maulik.khandwala wrote:

Hi there,

I am starting a new project. Just wanted to know whether RhinoCommon is compatible with .NET Core framework or not ?

thanks in advance.
Maulik Khandwala

Posts: 1

Participants: 1

Read full topic

Get excel accsess via VB

doc.Objects.Transform don't fires the RhinoDoc.BeforeTransformObjects event

$
0
0

@g.todeschini wrote:

Hello,

I think that there is a bug in RhinoDoc.BeforeTransformObjects event. It seems that the event is fired only if the transformation of the objects is done directly by the user using the Rhino commands. Instead, if I try to transform the document’s objects with

doc.Objects.Transform(obj_ref, xform, true)

in a custom command, the event RhinoDoc.BeforeTransformObjects is not fired.

Is it a bug or is it the correct behaviour?

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Zoom Extents

$
0
0

@kostadin wrote:

I load some data and add to the scene with my c++ plugin. How can I call ZoomExtents at the end? Further more, how can I call Zoom Extents for all viewports?

Posts: 3

Participants: 2

Read full topic

Trim curves within a box

$
0
0

@dsw wrote:

Hi

i’m curious about if there is an C++ function which finds all curves within a box (not necessarily an existing brep or mesh)?
In general something like this tool in grasshopper “Trim with brep” which returns all “inside” curves.

image

Posts: 2

Participants: 2

Read full topic

How get all CRhinoObjects?

$
0
0

@oktkhr0916 wrote:

Hi Guys.

This is simple question. I want to get array of all CRhinoObjects in active document.
Is there any method has provided to achieve it?

Thank you.

Posts: 1

Participants: 1

Read full topic


Display a dialog box interface

$
0
0

@15951991225 wrote:

Hello! I created a plugin for rhino5, I added a dialog resource to the .rc file, I want to display a dialog box interface when I runs the “PlugIn1” command, but I do not know what command code to add! This also seems to be related to dynamic link library. Are there any demos I can learn from?

Thanks!
//Joann

Posts: 3

Participants: 2

Read full topic

Rhino Plugin Updater

$
0
0

@rgr wrote:

Hi,

we want to make sure our users always have the latest version of a plugin. I found this, but is this actually implemented in V6?
What is the best way to update plugins without having the user to constantly check/redownload the plugins? If in a network situation, how can we push updated versions to the clients?

We used to have each user install the plugin from a network drive, this way we could just upload a new version and next time rhino got started it automaticly had the latest version loaded.

Posts: 1

Participants: 1

Read full topic

ETO - Binding to Collection

$
0
0

@mark_ortler wrote:

Hey people,

Currently I’m playing around with ETO and started to implement a MVVM-Pattern.
In the end it should be used within the grasshopper-workflow to build custom UI-Interfaces on the fly.

I have no no problem to bind to “single-value” Property, but when it comes to collection I can not wrap my head around. I have not found any useful guidance in the www to do so.

Do I need to use a ObservableCollection? or any special class to deal with this?

I mean, Its not a big deal to populate a control from a collection with code directly (mod in loop) but ya… Isn’t there direct binding-mechanism like its used, lets say, XAML? Maybe in combination with a converter-object?

If anybody has an advice (OR a good reference/link to a working pattern) I would be very thankful to hear from u.

Greets
Mark

Posts: 1

Participants: 1

Read full topic

A material with no corresponding RenderMaterial, potential bug?

$
0
0

@Taavi_Looke wrote:

Hi!

I have a weird model, where there seems to be a Material that doesn’t have an associated RenderMaterial in the RhinoDoc.RenderMaterials table. The plugin needs to look up the Material/RenderMaterial that is associated with a layer, however the Layer.RenderMaterial is null and Layer.RenerMaterialIndex seems to point to the correct material in the RhinoDoc.Materials table instead. And there is no Material associated with a Layer object.

Technically I could get around this problem by getting the material by calling the GetMaterial() on a RhinoObject on that layer (returns the correct material while GetRenderMaterial() returns null). However it would be better to understand if this is normal behaviour that there is a Material but no corresponding RenderMaterial? When could that be? Any ideas?

I’ve attached the file to the post, the layer and material that I’m referring to is text. The file came in as bug report from an user of the plugin I’m developing, so unfortunately I don’t know how it was created.
missing_material.3dm (7.7 MB)

Thanks,
Taavi

Posts: 1

Participants: 1

Read full topic

Modifying linked and embedded InstanceDefinitions

$
0
0

@Darryl_Menezes wrote:

Hi,
I use InstanceDefinitionTable.ModifyGeometry() to modify InstanceDefinitions in the document. This does update the geometry of the InstanceDefinition in the document. But if at all the InstanceDefinitionUpdateType of the block is LinkedAndEmbedded and has a source file located somewhere, is there a possibility to update this file too when the Geometry is updated?
(What I currently do is separately overwrite the source archive by exporting the geometry of the InstanceDefinition, using RhinoDoc.Write3dmFile())

Posts: 1

Participants: 1

Read full topic

Viewing all 8556 articles
Browse latest View live