Jump to content
Sign in to follow this  
sbarrett

Useful Geometry

Recommended Posts

Here are a couple wrappers that output sine and cosine waves. I thought the math enthusiasts might find these useful.

Sine Wave.vwx

Edited by sbarrett
  • Like 2

Share this post


Link to post

Sarah: thanks for sharing this.

Coincidentally, last week I thought I'd start with something 'simple' and try to make a sine wave in Marionette. (I had seen several Grasshopper tutorials on it, and it didn't seem overly complicated). Now that I see your Marionette example — wow — was I wrong.

I wish I could create something with this sine wave object, but lacking even a basic understanding of Marionette I wouldn't even know where to begin. :(

Share this post


Link to post

Yes I definitely think it would be possible, although you would go about it differently in Marionette than you would in Grasshopper. In Marionette, I would suggest you create the bricks first and distribute them (Move) to points along a sine wave line at each brick z level. You might need to do a little clever maneuvering to get the tangent vectors for each point (because there isn't a tangent node that I am aware of), but once you do, all you need is to translate those vectors into a rotation and use the rotation node along with the move node.

There are several nodes that work similarly to Grasshopper's Dispatch component, and they are in the Data Flow menu. For example, Filter, If, and Unzip are all nodes that parse lists.

I hope that helps - If you get stuck, I will be happy to offer suggestions!

Share this post


Link to post

Sarah - thanks for the advice and direction. It sounds like I would get lost pretty quickly, but I'll still give it a shot.

It sounds like a 'Tangent Vector' node is something that should be added to Marionette?

Share this post


Link to post

Tim - I would start with one of the aspect of the wall - a definition can get complex and overwhelming very quickly - but if you break down the problem into smaller projects you can combine them later. With the wall for example, don't try to build a parametric brick wall, try creating a series of locus points in 3D. Then try distributing rectangles along a line, etc. If you think of a project in much smaller, simpler steps it will be easier to build in Marionette. Also, those individual parts can be used over again in different definitions.

Share this post


Link to post

Hello Sarah

It's very useful. Thank you

Can post such example?

I will post code which inside in any dummy node(not wrapper) and somebody can to put it into node code(for example one of points category nodes) + also if you install scipy, numpy(python extesions)

Code based at such code and frensel functions of scipy

'''
Based at http://stackoverflow.com/questions/13308573/scipy-what-are-the-arguments-in-scipy-special-fresnelx-out1-out2

'''
@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
this = Marionette.Node('Frensel Points')
this.SetDescription('Create scipy.frensel Points')
npts = Marionette.OIPControl( 'Number of points', Marionette.WidgetType.Int, 100)
npts.SetDescription('Number of points at curve')
curlsn = Marionette.OIPControl( 'Number of curls', Marionette.WidgetType.Int, 3)
curlsn.SetDescription('Number of curls')
sca = Marionette.OIPControl( 'Scale', Marionette.WidgetType.Bool, False)
sca.SetDescription('Scaled version')
scan = Marionette.OIPControl( 'Scale', Marionette.WidgetType.Int, 1)
scan.SetDescription('Scale of curve')
pt = Marionette.PortOut()
pt.SetDescription('Frensel Points on the xy plane')

def RunNode(self):
import numpy as np
from scipy.special import fresnel

num = self.Params.npts.value
curl = self.Params.curlsn.value
sca = self.Params.sca.value
scalen = self.Params.scan.value

t = np.linspace(-curl, curl, num, endpoint=True)	
ss, cc = fresnel(t / np.sqrt(np.pi / 2))
scaled_ss = np.sqrt(np.pi / 2) * ss
scaled_cc = np.sqrt(np.pi / 2) * cc	
if sca:
	fpts = []
	for i in range(num):
		fpts.append((scaled_ss[i]*scalen, scaled_cc[i]*scalen, 0.0))
	self.Params.pt.value = fpts
else:
	fpts = []
	for i in range(num):
		fpts.append((ss[i], cc[i], 0.0))
	self.Params.pt.value = fpts

Edited by Ilay

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×