Week 6

Arch 2042 2012 Spring

Course Arch 2042
Date 2012/04/06
Learning Objectives In this class, we will be learning how to parametrize curves more generally in 3D. We will also learn how to control a drawn curve in Rhino by accessing its parameters. We will start the topic of parametrizing surfaces by looking at the specific class of surfaces called graphs. Then we will introduce cylindrical and spherical geometries and expand the surface representation to those parametrized with those coordinate geometries.
  • Midterm Presentations
  • Parametrizing Curves in 3D
    • Representing a curve parametrically
    • Controlling a drawn curve by accessing its parameters
  • Parametrizing Surfaces
    • Drawing graphs
Uses Tool(s)

Parametrizing Curves in <math> \R^3 </math>

ParametricCurves.jpg Here is an introduction to parametrizing curves in space: Curves . As you are reading this, you might find it useful to play with the script DrawParametricCurve.py (located in your samples folder). Try out the example curves as well as ones that result from assigning your own functions <math> x(t), y(t), z(t) </math>.

While it is certainly useful to know how to parametrize curves, we'd be in trouble if we could only work with curves that we knew how to parametrize. Take a circle in the plane that is transformed by rotation so that it lies in the tilted plane <math> x = y </math>. While this is quite easy to create in Rhino, it is relatively difficult to come up with a parametric representation for this curve. Also, it may be the case that you have a freeform curve that satisfies some site constraints which again can be drawn as if you were drawing freehand, but may be very cumbersome to describe in terms of a parametric equation. For all of these reasons, it will be important to understand how to control a drawn curve by accessing its parameters. Here is a very brief illustration of this (done in class):

import math
import rhinoscriptsyntax as rs
#1.  Parametric Curves in R^3
#First play with DrawParametricCurve.py
#Most of the time, we will be drawing up a freehand curve and we want
#to be able to access features of the drawn curve, including specific
#points on it
# First draw up a curve and get the curve object
curve = rs.GetObject("Select curve", rs.filter.curve)
# We can always access the starting point, midpoint, and endpoint of a
# drawn curve
startPoint = rs.CurveStartPoint(curve)
midPoint = rs.CurveMidPoint(curve)
if not rs.IsCurveClosed(curve):
	endPoint = rs.CurveEndPoint(curve)
# When you draw up a curve, it will parametrize it automatically with a
# curve interval [a,b] which you can access.  
domain = rs.CurveDomain(curve)
print "Curve domain [a,b] = [", domain[0], ",", domain[1],"]"
# Within this domain, we can evaluate any point along the curve at a
# specific parameter
t = domain[1]/4.0
pointAtParameter = rs.EvaluateCurve(curve, t)
#rs.AddTextDot("t = "+ str(t), pointAtParameter)
# or if you think better in terms of the interval [0,1] you can always
# use a normalized parameter (between 0 and 1) and use the conversion function
#to get the parameter on the curve
normalized = 0.75
tConverted = rs.CurveParameter(curve, normalized)
print "Curve parameter:", tConverted
# By having control over the parameters along the curve, we can manipulate
# the curve with functions like splitting and trimming
# Let's trim a curve so that only the portion between an interval t0 and t1 is kept
t0 = rs.CurveParameter(curve, 0.3)
t1 = rs.CurveParameter(curve, 0.85)
curveTrim = rs.TrimCurve(curve, (t0,t1))

Parametrizing Surfaces


In analogy to parametrizing curves, where a curve is the image of a map of a straight interval in <math> \R^{1} </math>, a parametrized surface is the image of a map of a flat domain in <math> \R^{2} </math>.

You can read ahead for next week where we will be covering parametric surfaces .