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

Creating "Real" Drill holes for clean Step Export

$
0
0

@MartinIC wrote:

Hi everyone,

we created a lot of Step File for Sheet metal production using Rhino Common.

Our general approach was:
- extrude a Profile Curve as an Extrusion
- change it to a Brep
- select an Extrusion from the document
- change it to a Brep too
- cal the Boolean Difference from both.

If we export this File as a STEP file, the cut in drill holes are not "real" holes, but made out of two Half Circles (red an cyan)
The Edge curve is not a circle, nor an ARC

Other Software packages can't detect these holes to be drills - which raises the question.

How can we create "REAL" Round Holes and "Revolved" Holes through Rhino Common

Not sure if this example is actually better - but the edge curves are ARCs here. This was created by the "_roundHole" command. Still the edges are split though.

This is an Example of a STEP File created by Inventor:

It's one Surface and 3 Arc Edges (also not a circle)

Thanks
Martin

Posts: 7

Participants: 3

Read full topic


Ruled solid from ruled surface with Brep.CreateFromOffsetFace (C#)

$
0
0

@gatoth wrote:

So I am trying to make a ruled solid from a ruled surface, however using the Brep.CreateFromOffsetFace does not yield the desired results. Around the edges, where the parts of the ruled surface are only G0 continous, the offseted corners are not sharp, but rather creased. To show in pictures:

The rhino result:

The desired result:

For more reference, the generating surface, and the generated (and trimmed) solid:
ruled.3dm (157.4 KB)
ruledsurface.3dm (79.5 KB)

My first question is, that am I using the right RhinoCommon method for this assignment?

Regards,

Gábor Tóth

Graphisoft, Hungary

Posts: 4

Participants: 3

Read full topic

What does surface intersection do

$
0
0

@kasper_steenstrup wrote:

We are a team on a university that dons a lot of algorithm, using rhino as the visualization tool and some of the build in function.

But we have not be able to detect if the surface intersection algorithm does. Especial if it is using interpolation or approximation(fitting) of the intersection points are preformed or if it is done in the control point.

We suspect that a interpolation is done, do to the large amount of control points created in the intersection curve, but we don't know.

Posts: 3

Participants: 3

Read full topic

Automate Upgrade of Rhino with CounterSketch

$
0
0

@jstevenson72 wrote:

All:

We are trying to automate a silent upgrade of CounterSketch Studio and Rhino 5 to 64 bit. I am writing code to automate the installation of the Rhino MSI and then the CS installer.

Is there a way to extract the users Serial Key from their current installation in order to feed it to the MSI during the installation of the update so that we do not have to have the Rhino Installer prompt for the key?

Thanks for any help you can be.

Jake Stevenson

Posts: 4

Participants: 2

Read full topic

Trying to Blend surface C#

$
0
0

@jed_segura wrote:

I am currently trying to make a method that takes 2 breps, gets the closest edges on each respective brep, then simulates the "BlendSrf" function that is available in Rhino. The way that I'm doing it is by using the CreateEdgeSurface function and passing in the closest edges on each brep in an array.
My issue comes in when I want to change how the curve looks by changing the Curve Continuity, like the BlendSrf function can. The CreateEdgeSurface function has no overloads to enable me to do this. I also tried just using the CreateBlendCurve twice with reversing the order of the curves to make different curves, but the curves looked alot different than when blendsrf did the same thing.
Help?

Posts: 6

Participants: 2

Read full topic

Can't add custom UserData to Layer? (rhinocommon)

$
0
0

@bcook wrote:

I am able to add an item to the UserDataList member (UserData) of a layer, but only if it is a pre-defined UserData class like UserDictionary. If I try to add my own data derived from Rhino.DocObjects.Custom.UserData, I get an exception ("Object reference not set to an instance of an object."). My UserData-derived class looks like this:

 [Guid("359B9A80-5937-4C55-A35E-367E968B933D")]
    public class OrcaReferenceLayer : UserData
    {
        public OrcaReferenceLayer() : base() { }
        public override string Description
        {
            get
            {
                return "orca reference layer";
            }
        }
        public override string ToString()
        {
            return "Orca Reference Layer";
        }
    }

I have also tried adding a PhysicalData item from the example code to no avail. Is there something obvious I am doing wrong?

Posts: 2

Participants: 2

Read full topic

Background screen capture thread

$
0
0

@amit.lzkpa wrote:

Hi,

Is there a way to start a background thread that continually performs screen grab and pushes the screen grab to a socket?

I am currently working in RhinoPython.
Following is a part of what I have:
`


import Rhino
RhinoDocument = Rhino.RhinoDoc.ActiveDoc
view = RhinoDocument.Views.Find("Perspective", False)

width = 1080
height = 720
size = System.Drawing.Size(width,height)`

def updateOneSecond():
    frames = 75                     # i am targeting 75 fps, on a gaming rig
    for i in range(frames):
        capture = view.CaptureToBitmap(size)
        # the save to file is just hold in function
        # I want to stream it without storing it
        file_name = "E:\\....\\cap" + str(cyc) + str(i) + ".bmp"
        capture.Save(file_name)
    print("Process complete")

This is a demo example, where I am writing the screen capture to a file. For my actual use, I plan to set up a continuous loop, which performs the screen grab and serves the bitmap as a server to a socket address and another application(an Oculus) will be listening to that address and collect the bitmap data.

It is important to hand the control back to the user for working normally with the file. So I figured the continuous loop should be ideally located on a parallel thread.

I came across the following parts which I believe may be a solution, but I have no clue what exactly they do and the documentation didn't covered them in much detail.


# the ForEach method kept asking for a thread as the first argument
# i am not sure how do I create a new thread and pass it to that method
import System.Threading.Tasks as tasks
tasks.Parallel.ForEach(<some thread name>, updateOneSecond())

# Thread has some methods under it, which sound relevant with method names like
# 'Invoke', 'Start', 'IsBackground', but I don't know to use them.
from System.Threading import Thread, ThreadStart, ParameterizedThreadStart

Also, I came across posts which documented that document methods can't be accessed from parallel threads, but there seems to be an ugly hack for it.
It's in C# I think, and I am having tough time figuring it out.
Ugly hacks will work for me for the time being.

Any help will be appreciated.
Thanks.

Posts: 1

Participants: 1

Read full topic

Change viewport title background color


Clockwise or counter clockwise orientation error

$
0
0

@mprades wrote:

Hi guys
I have a problem with this curves.
I want to get a clockwise closed curve from this want

And I use the following code:

if (curvaCerrada.ClosedCurveOrientation(Plane.WorldXY) == CurveOrientation.CounterClockwise)
{
       curvaCerrada.Reverse();
}

But, curvaCerrada.ClosedCurveOrientation(Plane.WorldXY) returns the curve is clockwise.

cuadradoAntiHorario.3dm (13.9 KB)

Someone can help me?

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Automate tsExtrude using RhinoCommon

$
0
0

@el_mariachi wrote:

Hi,

I'm fairly new to Rhinocommon, and was looking at automating some of my tsplines commands with C# in Visual Studio. In particular, I would like to start with a single row of tsplines panes, and extrude the top edge up 'n' times by a fixed distance (I figure if I can do this in front of a scanned mesh with retopo switched on, I can have a smooth tsplines object that represents scanned data, without crashing rhino, or going mad with constantly extruding edges). However, tsExtrude doesn't take any parameters in the Rhino command line, and the Rhinocommon API doesn't give me the guts of Tsplines commands.

Has anyone tried something similar?

Posts: 1

Participants: 1

Read full topic

How can I add a Content to panel plug-in

$
0
0

@11139 wrote:

Situation : I'm trying to make a wpf panel plug-in by referencing sampleCSWpfPanel.(Sorry, I forgot where did I find that Code)

Problem : I cannot find a way to add a button(or any other object) to stackpanel of the panel.
(For example, When I click a button on another panel(or window), a button should be Added to the stackpanel)

Does anyone know how to solve this problem?

*Sorry for my poor English.

Posts: 2

Participants: 1

Read full topic

How to loft in the SDK with Match Start Tangent and Match End Tangent?

$
0
0

@gordon wrote:

So we have 2 Brep Edges, and are trying to (in C#) loft between them with matching start and end tangent.

To demonstrate the results I am looking for, do the follow)
Create 2 planar surfaces in the top viewport (from 4 corner points SrfPt), rotate one of them in the front viewport, so that they are not both in the same plane.
Now run the command loft, pick 2 brep edges 1 from each surface with the mouse, press enter, and then in the dialog box that pops up click the boxes next to 'Match start tangent' & 'Match end tangent'
Next click the Preview button, (or OK) and you get a nice smooth surface that flows between the original 2 surfaces.

How can this be done from C#? using either RhinoCommon or Rhino .NET SDK?

I have tried the example here:
http://wiki.mcneel.com/developer/sdksamples/loft
adapted it to pick OnBrepEdge's and then experimented with:

        args.m_bAllowStartTangent =true;
        args.m_bAllowEndTangent = true;

and also:

        args.m_start_condition = (int)IArgsRhinoLoft.eLoftEnds.leTangent;
        args.m_end_condition = (int)IArgsRhinoLoft.eLoftEnds.leTangent;

and other combinations, but cannot achieve the result described above from using the loft command.

Is this result possible? or am I out of luck?

in this image, you can see the black wireframe brep made from the Loft command, and the gold flat result is all I can get back from my C# code.

Posts: 2

Participants: 2

Read full topic

Tips for cross platform plugin development / debugging

$
0
0

@tree wrote:

Hello,

I'm curious if anyone has any especially useful tips or especially useful discoveries for cross platform plugin development.

I'm struggling with a complex plugin originally created for the windows environment that I'd like to port over to mac. I haven't yet been able to get beyond the 'this plugin is incompatible' window that appears on detecting the newly created/ported plugin.

Posts: 4

Participants: 3

Read full topic

Implementing an own PopUpMenu - C++

$
0
0

@eloquence wrote:

Hello!

When objects are overlapping, selecting them opens a popup menu which lets you choose, which object you want to select.

Is there anyway to implement an own popup menu which then gets used instead?

The use case I have is the following:

CRhinoGetObject go;
go.SetCommandPrompt( L"Select objects" );
CRhinoGet::result res = go.GetObjects( 1, 0 );

I have special, "hidden" objects - relations, which are connected to the objects. While the user is selected objects, e.g. some mesh, I want to show him my own pop up menu to allow him to decide between the mesh or my "hidden" relation.

Best Regards.

Posts: 1

Participants: 1

Read full topic

BrepBrep intersection not threadsafe in Rhino 5 64bit?

$
0
0

@SmallChief wrote:

Using the Grasshopper python component I wrote a code that intersects lots of breps with each other.
To make it faster I used parallel processing wich worked fine under Rhino 5 32bit, on a 64bit Rhino the component crashes my whole Rhino instantly.

The function used was Rhino.Geometry.Intersect.Intersection.BrepBrep()

Is this function not threadsafe?

Posts: 3

Participants: 2

Read full topic


Plugin with advertising - permissible?

$
0
0

@Keith1634 wrote:

Hi McNeel,

I am thinking of adding paid advertising to my plugin via a modal dialogue - is this permissible ?

Just thinking of ways to help make my plugin become more available.

thx,
Keith

Posts: 7

Participants: 4

Read full topic

How to write a message in the command line window?

$
0
0

@jordi wrote:

I would like to write a message in the command line window (not in the command history window) in a similar fashion as some commands do, for example: "Meshing... Pres Esc to cancel".

I found a Write function which uses UnsafeNativeMethods.CRhinoApp_Print(), but I would like to find an easy to use method. I think SetCommandPrompt is not a solution either. Do you know a way to do it?

Thanks,

Posts: 3

Participants: 2

Read full topic

"True" split of surface into new surfaces

$
0
0

@camalamadingdong wrote:

I am using Rhino to generate hull surfaces. (they are actually for wave energy converters, but it is similar to a ship hull). I need to create the entire hull surface (portion above and below the water line, where the waterline can be represented as a plane), then I need to delete the portion above the waterline, and just export the portion below the waterline.

It is the same conceptually as what this person was doing: http://discourse.mcneel.com/t/splitting-a-surface-using-rhinoscript-and-deleting-upper-surface/16428

EXCEPT, I want to export Nurbs surfaces not a Mesh (the poster above was exporting a mesh). (_SaveAs name.gdf)

The program that I (and the poster mentioned above) are using is called WAMIT and it solves the hydrodynamics of a submerged hull. It can take a mesh, or a Nurbs surface as a series of Nurbs panels. The solution with a Nurbs is much faster and more accurate.

However, WAMIT can't handle Rhino trimmed surfaces. If a surface is trimmed (as with the Split or Trim commands), the _SaveAs name.gdf command exports the underlying surface, not just the trimmed surface.

Is there a way, or a plug-in, or a recommended way to write a plug-in (I'm already writing a plug-in) to make a "true" split of a Nurbs surface and create two new Nurbs surfaces (Brep.IsSurface = true)?

Posts: 6

Participants: 3

Read full topic

Legal Rhino?

$
0
0

@jordy1989 wrote:

Hi All,

Is there a way to check if the rhino that is installed is legal?

Someone asked me to make an expansion of their software. They already have a plugin and I just created a second plugin for my part. Rhinoceros will already be installed since most people already use their software. Is there a way to check if the Rhino that is installed is legal?

Am I guilty if my plugin gets installed on a computer where an illegal Rhino is installed?

Posts: 1

Participants: 1

Read full topic

Eto - Dropdown binding fails on Mac

$
0
0

@thomas wrote:

So, I have a nice little Eto dropdown that should get populated from a list with custom objects.

The following code works in Windows (RH6), but fails in Mac. In the latter, instead of text values, the control shows the object type.

class MyObject
{
        public string Key { get; set; }
        public string Name { get; set; }
}

//---------------------

List<MyObject> myObjects = new List<MyObject>();
// ... fill list

var selector = new DropDown
            {
                DataStore = myObjects,
                ItemKeyBinding = Binding.Delegate<myObject, string>(a => a.Key),
                ItemTextBinding = Binding.Delegate<myObject, string>(a => a.Name),
            };

In Mac, the selector shows the type name instead of the name values:

MySolution.MyObject
MySolution.MyObject
MySolution.MyObject
MySolution.MyObject
MySolution.MyObject

Is this a bug or am I missing something?

Posts: 5

Participants: 3

Read full topic

Viewing all 8546 articles
Browse latest View live