question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get compass Vector from grasshopper

See original GitHub issue

Feature Request

Related to #512 I noticed there is no RhinoVector wrapper. Is there a way to get vector input from GH interface and convert it to compas.geometry.Vector

I would like to do something like this:

vector = RhinoVector.from_geometry(geometry).to_compas()

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gonzalocasascommented, Apr 28, 2020

you don’t need to use v.data, just cast it to a list before you pass it to the constructor of rg.Vector3d:

import Rhino.Geometry as rg
from compas.geometry import Vector

rhino_v = rg.Vector3d(100, 20, 10)
print (rhino_v)

compas_v = Vector(*rhino_v)
print (compas_v)

rhino_v2 = rg.Vector3d(*list(compas_v))
print (rhino_v2)
1reaction
yck011522commented, Apr 28, 2020

@tetov Thanks for the PR I look forward to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get a compas Mesh from grasshopper #512 - GitHub
Describe the bug Maybe this is a simple question. In the old days, there is a function "mesh_from_guid" in the helpers.
Read more >
North - Ladybug - Component for Grasshopper
Use this component to create a compass sign that indicates the direction of North in the Rhino scene.
Read more >
Grasshopper Tutorial: Vectors - YouTube
In this tutorial, I cover the basic Vector components in Grasshopper 3d.
Read more >
Why the "angle between vectors" component is always positive?
I have to know the angle between a lot of vectors, but some times this should be negative, I thought that this component...
Read more >
Force Fields in Grasshopper - designcoding
For instance, a vector field in the plane can be visualized as a collection of arrows with a given magnitude and direction, each...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found