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

Intermittent compatibility issues

$
0
0

@Arthur wrote:

Hello all,

Apologies if a similar topic exists, but I haven’t been able to find anything quite like this on here. I’m running into an issue moving my plugin (Pachyderm) over to Rhino 6. I have set up Visual Studio so that it outputs both a Rhino 5 and a Rhino 6 version. Only two code files differ between the two projects. So far so good!

The project builds, and sometimes it starts in Rhino 6, no issues. Other times, it either does a 12 second compatibility check and rejects the plugin, or just claims that the plugin is incompatible with Rhino 6. What gives?

This is pretty frustrating. Could someone please tell me what the compatibility check is looking for, and maybe share any insight into why this might be happening, and what I can do to eliminate it altogether?

Thanks in advance!

Arthur

Posts: 7

Participants: 3

Read full topic


C++ adding mesh faces

$
0
0

@Petras_Vestartas wrote:

Hi,

I would like to ask why contrary to .NET in C++ adding mesh faces requires specifying additional vertex id.
For instance when adding 1 quad face it requires 5 vertex ids, and when adding triangle face 4 vertex ids (instead of 3 in .NET) What is the reason for that? And it is not necessary the same id first and last vertex.

Example from Dale Tutorials:
mesh1.SetVertex(0, ON_3fPoint(0.0f, 0.0f, 1.0f));
mesh1.SetVertex(1, ON_3fPoint(1.0f, 0.0f, 1.0f));
mesh1.SetVertex(2, ON_3fPoint(2.0f, 0.0f, 1.0f));
mesh1.SetVertex(3, ON_3fPoint(3.0f, 0.0f, 0.0f));
mesh1.SetVertex(4, ON_3fPoint(0.0f, 1.0f, 1.0f));
mesh1.SetVertex(5, ON_3fPoint(1.0f, 1.0f, 2.0f));

mesh1.SetQuad(0, 0, 1, 5, 4);
mesh1.SetQuad(5,6,7,11,10);

Posts: 5

Participants: 2

Read full topic

ChangeSpace equivalent workflow

$
0
0

@Willem wrote:

Hi,

I’m looking for a way to mimic the ChangeSpace command behaviour,
Specifically I’d like to get 3D silhouettes from a detail view and transpose those on the layout over the detailview.

Am I missing the obvious, or is there indeed no other way then to create this functionality by taking into account all variables like the detail properties, layout view properties etc…
In effect subjecting the 3D silhouettes to a series of transforms to align them with the detail.

Thanks
-Willem

Posts: 3

Participants: 2

Read full topic

Limited Save version of R5 / R6 instead of time?

$
0
0

@ChristopherBotha wrote:

hey all,

Is there a limited save version download link to R5/R6 that I can bundle with a plugin? (like in the old days?)

my plugin will add functionality outside of normal rhino usage to attract users into it as well. (pulling in and fixing jewelcad files for one) While I am deploying in beta, it may take more than the 90 days limited version to finalize and add tools after which the plugin stops working.

TIA
CB

Posts: 2

Participants: 2

Read full topic

CRhinoPlugIn::OnUnloadPlugIn()

$
0
0

@kostadin wrote:

Hi all, as a plug-in developer, I experience issues on Rhino 6 if my plugin is working and the user presses [x] button of Rhino 6 and closes Rhino. At this moment according to the SDk the only way for the plugin to understand that Rhino is exiting is:

// Description:
// Called one time when plug-in is about to be unloaded. By this time,
// Rhino’s mainframe window has been destroyed, and some of the SDK
// managers have been deleted. There is also no active document or active
// view at this time. Thus, you should only be manipulating your own objects.
// or tools here.
virtual void OnUnloadPlugIn();

The problem is that at this moment, the plugin may still need Rhino to be fully working to make calculations, queries or whatever to the Rhino app. Currently it is too late for the plugin to do anything.

Proposal - can you have another function like OnRhinoIsExiting() or PreDestroy() or RhinoIsAboutToExit() where the plugin can tidy up everything dependent on Rhino core/classes.
Or simply unload the plugins before shut down the whole framework.

(Just to mention that this problem doesn’t exists on Rhino 5)

Regards
Kostadin

Posts: 2

Participants: 2

Read full topic

Reference Brep in C++ Learning

$
0
0

@Petras_Vestartas wrote:

Hi,

Learning… Simple question.

How can I reference Brep in Rhino C++?

If I do it like this it references only a one brep face

	CRhinoGetObject g;
	g.SetCommandPrompt(L"Select Brep");
	g.SetGeometryFilter(CRhinoGetObject::surface_object);
	g.EnableSubObjectSelect();
	g.GetObjects(1, 1);

	if (g.CommandResult() != CRhinoCommand::success)
		return g.CommandResult();

	const ON_Brep* brep = g.Object(0).Brep();

	if (brep == 0)
		return CRhinoCommand::failure;

Posts: 2

Participants: 2

Read full topic

What use of Nancy?

$
0
0

@kitjmv wrote:

Hello !

I see in the Rhino installation directory, the Nancy.dll an Nancy.Hosting.Self.dll library

I’m curious, why Rhino embed a server host ? it is for Grasshopper ?

Thanks

Posts: 2

Participants: 2

Read full topic

Problem with ApplyMeshInstanceChanges and linked blocks

$
0
0

@ParanoidAndroid wrote:

Hi,

when I double click a block element that consists out of two cuboids and move one of them to modify the block I run into this problem:

  • 2 cuboids (mesh defs X & Y and mesh instances x & y) exist in a linked block
  • I double click the linked block
  • 2 mesh defs. are created (A & B)
  • 2 mesh instances are created (a & b)
  • I move one cuboid (X,x) around and confirm the operation
  • 4 mesh defs are reported as added or changed (A, B, X, Y) two of them are reported as deleted at the same time (X, Y)
  • 4 mesh instances are reported as added or changes (a,b,x,y) two of them are reported as deleted (x,y)

In all of your examples and the RhinoCycles renderer you remove the elements that are added and deleted at the same time from the “deleted” elements but here it seems to differ from the usual way of handling things.

What is the correct approach to work with the API in this scenario? Currently, I end up with 4 cuboids instead of 2.

Posts: 4

Participants: 2

Read full topic


Force a Mesh to update its acceleration structure

$
0
0

@atair wrote:

When i join two meshes a and b with:
a.Append(b);
it does not update its internal acceleration structure, so a.ClosestPoint(..) only sees the original a mesh part…
My workaround is to create one double vertex, run Weld() and then the structure updates.
Any clean way to do this?

Still on V5 as V6 meshes are very broken: RH-46728 - hope someone fixes this soon…

Posts: 2

Participants: 2

Read full topic

Python Algorithm: Frei Otto Wool Thread Experiments

$
0
0

@Lei_Yang1 wrote:

Hello guys,

anyone knows where find the python code about simulating ‘Frei Otto Wool Thread Experiment’?

Thanks,
Lei

Posts: 1

Participants: 1

Read full topic

Detail symbol scale

$
0
0

@onrender wrote:

Hi there,

(This is a bit complex question.)

I am wondering if it is possible to leave the scale of certain objects, detail symbols (section line, levels) static on layouts. For example when I create a layout in 1:100 and 1:50 the section line symbol can be the same size on both layouts.

Alternatively can I use script to find the location of the model section lines on the layout? So, the script would automatically draw the section lines onto the layouts in the same position as in the model.

Posts: 1

Participants: 1

Read full topic

C# . Problem with FindByUserString, Curves

$
0
0

@pedro.iserte.llacer wrote:

Hello everybody. I’m a long time Rhino and Grasshopper user, I have just started doing some programming. Some basic scripts have worked “flawlessly” with help of the solutions offered in this forum, but now I ask for your help.

I’ve been trying to filter the geometry in a Document to find some objects that I had already tagged with some user strings. The selections goes ok, but then I do not know how to “extract” the curves from the objects. And the objects should already be curves, for I use ObjectType.Curve as a filter on the FindByUserString parameter.

Any Idea how I could solve my problem??? Thanks!!!

        RhinoObject[] TrazasDoc = doc.Objects.FindByUserString("Alignment", "true", false,true,true,ObjectType.Curve);
        List<Curve> Trazas = new List<Curve>();

        foreach (RhinoObject TrazaDoc in TrazasDoc)
        {
            if (TrazaDoc. ??????? = ObjectType.Curve)   <--------------------------------------------
                Trazas.Add(TrazaDoc[0]);
        }

Posts: 3

Participants: 2

Read full topic

Dictionary Data has been removed, When using "split" command to split Brep which has binding custom "key-value" information

$
0
0

@cughudson wrote:

I have an Brep Geometry which has binding dictionary data(aka “key-value” pair data) ,But surprise me is that, when I using command “split” to split the Brep, The dictionary data has been removed or disapper, And I don’t know Why. Is anyone to help me? Thanks.
(My Rhino Software version is 5)

Posts: 1

Participants: 1

Read full topic

Add Multiple Commands for plugin

$
0
0

@gabor.konstanzer wrote:

Hey guys. My question would be the following. What would be the proper way of adding multiple Commands for the command line, with my plugin. My problem is that i have multiple functionalities in my C# plugin which i want to be available as command line Commands, so that people can write macros or scripts with them. Is there any other way of doing this, than having as many Command classes as many functions i want to make available, or is there some easier, maybe a bulky way to register them?

Thanks, in advance
Gábor

Posts: 2

Participants: 2

Read full topic

Rotation of different surfaces that conform an object

$
0
0

@f.leon.marquez95 wrote:

Hello, I am trying to select different surfaces and then try to rotate them along an axis, but I can’t achieve it because in order to rotate, I need to assign a different object name to each object. The number of surfaces selected can vary. I am using Rhino 5 and visual Studio 2010.

CRhinoGetObject go;

go.SetCommandPrompt( L"Select surfaces" );
go.SetGeometryFilter( CRhinoGetObject::surface_object );
go.GetObjects( 1, 0 );
if( go.CommandResult() != success )
	return go.CommandResult();
// Validate selection


const CRhinoObjRef& obj_ref = go.Object(2);
const CRhinoObject* obj = obj_ref.Object();

if ( go.Result() == CRhinoGet::object )

{ 
	int i, object_count = go.ObjectCount();
	for ( i = 0; i < object_count; i++ )
	{ 
		const CRhinoObjRef& obj_ref = go.Object(0);
		const CRhinoObject* obj = obj_ref.Object();
	}
}

ON_wString prompt("");
prompt.Format( L"Number of selected surfaces: %d \n", go.ObjectCount());
RhinoApp().Print( prompt );

CRhinoGetObject go1;

go1.SetCommandPrompt( L"Select border" );
go1.SetGeometryFilter( CRhinoGetObject::curve_object );
go1.GetObjects( 1, 1 );
if( go1.CommandResult() != success )
	return go1.CommandResult();
const CRhinoObjRef& refBord = go1.Object(0);
const CRhinoObject* obj_bord = refBord.Object();
const ON_Curve* border = refBord.Curve();
if( !border )
	return failure;

ON_3dVector axis_normal(1, 0, 0);
    ON_3dPoint lowP(0, 0, 0);
ON_Xform xform;
xform.Rotation(-1*0.53,axis_normal,lowP);
//we rotate the angle
const CRhinoObjRef refSurf_new = context.m_doc.TransformObject(obj, xform, true, true, true);
const ON_Surface* srf_new = refSurf_new.Surface();
const CRhinoObjRef refbord_new = context.m_doc.TransformObject(obj_bord, xform, true, true, true);
const ON_Curve* border_new = refbord_new.Curve();

context.m_doc.Redraw();
	
return CRhinoCommand::success;

Posts: 1

Participants: 1

Read full topic


Eto WebView inactive keyboard

$
0
0

@kitjmv wrote:

Hello !

I have a Eto WebView in a Rhino panel but inside the web page the keyboard : ctrl-c, ctrl-v, tab or directional are not capture. (this page works outside Rhino/Eto)

Do you have an idea?

Thanks!

Posts: 3

Participants: 1

Read full topic

UVEditor & ExtractUVMesh bug?

$
0
0

@clement wrote:

@Jussi_Aaltonen, @DavidEranen,

in the last decade i’ve been using my own scripts to unwrap UVs of 3D meshes which worked fine. Recently i’ve developed a tool to remap objects from a 2D mesh (created by UV unwrapping) onto a 3D mesh. While testing this out i’ve found that sometimes the face count, vertex count and almost always the vertex ordering per face is changed by Rhino’s _UVEditor and _ExtractUVMesh commands. This is especially problematic if i rely on the topology of the meshes to remap from / to.

Attached is a very simple example where i can repeat that behaviour. I’ve numerized the first 4 vertices. After unwrapping the cylinder using _ExtractUVMesh , the face and vertex count properly matches. However, the vertex order is not preserved. The 2D mesh has the following vertices for the first face:

2D Mesh: FaceIndex: 0 >>> 0,1,2,3

while the 3D mesh gives me these vertices:

3D Mesh: FaceIndex: 0 >>> 0,99,101,9

Is this expected ? I get the same results in Rhino 5 but i am not sure if this is correct. If i use one of my own unwrappers which creates a 1:1 swap between texture coordinates and vertex positions, the face vertex ordering is 100% identical.

Cylinder_FaceVertexOrder.3dm (100.2 KB)

_
c.

Posts: 2

Participants: 1

Read full topic

Texture rotation not consistent between Rhino 5 and 6

$
0
0

@Simon_Weinberger wrote:

Hi,

was there a change in regards to the rotation of textures? The texture is rotated in the other direction in Rhino 6, compared to Rhino 5. Is this a bug in Rhino 6 or in Rhino 5 or intended behavior?

Repro: Open attached model in Rhino 5 and Rhino 6 and look at different texture in viewport.

But I get the same Texture.UvwTransform. Do I have to interpret the values differently in both versions?

texturerotation.3dm (407.0 KB)

Posts: 1

Participants: 1

Read full topic

C++ Adding Block to Rhino

$
0
0

@Petras_Vestartas wrote:

Hi,

I am following how to create blocks tutorial:

I would like to ask if this tutorial is supposed to block existing objects in rhino?
The issue is that when I run this code and select for instance cube and cone it does not convert them to blocks. However there is a block instance in block manager (But no physical object on rhino canvas).

So I would like to ask how to add block object to rhino? What additional code I have to write?

Posts: 1

Participants: 1

Read full topic

C++ Add layer changed syntax

$
0
0

@Petras_Vestartas wrote:

Hi,

I am following this tutorial to add child layer, but the syntax of Current Rhino SDK was changed:

I tried to write something like this and I have one error in line
child_layer.SetParentLayerId(layer.Id);//Error C2276 '*': illegal operation on bound member function expression
also tried:
child_layer.SetParentLayerId = layer.Id; // Error C2659 = function as left operand

How can I correctly change parent layer id?

CRhinoCommand::result CCommandLearning180704::RunCommand(const CRhinoCommandContext& context)
{

	
	CRhinoLayerTable& layer_table = context.m_doc.m_layer_table;

	//Define parent layer
	ON_Layer parent_layer;
	parent_layer.SetName(L"Parent");

	//Add parent layer
	int parent_layer_index = layer_table.AddLayer(parent_layer);
	if (parent_layer_index >= 0) {
		//Get the layer we just added
		const CRhinoLayer& layer = layer_table[parent_layer_index];

		//Define child layer
		ON_Layer child_layer;
		child_layer.SetName(L"Child");

		//Assign parent layer's id as child's parent id
		child_layer.SetParentLayerId(layer.Id);//Error	C2276	'*': illegal operation on bound member function expression


		//Add child layer
		layer_table.AddLayer(child_layer);
	}
	
	return success;
}

Posts: 4

Participants: 3

Read full topic

Viewing all 8557 articles
Browse latest View live