f

#### Divide Cubic Bezier into equal length segments

```Hi,
I have to animate an object along a bezier curve.
So, if I want to create 100 frames, I have to split the curve in 100
equal length segments.
As you know the t parameter is not linear, so if I pass t = 0.5 I get
a point which is not at half-a-distance from the first point of the
curve, and this is wrong to me. So, how should I divide the curve in x
segments with equal length? I have checked this group but it's not yet
clear to me how to do. Any help? Any function returning xyz coords by
passing a linear t parameter (based on the whole length of the curve)
would be greatly welcome. Thank you.

``` 0 5/17/2007 8:51:31 PM comp.graphics.algorithms  6674 articles. 1 followers. 1 Replies 732 Views Similar Articles

[PageSpeed] 29

```"Mark3D" <topolone_blu@hotmail.com> wrote in message
news:1179435090.993682.302800@p77g2000hsh.googlegroups.com...
> Hi,
> I have to animate an object along a bezier curve.
> So, if I want to create 100 frames, I have to split the curve in 100
> equal length segments.
> As you know the t parameter is not linear, so if I pass t = 0.5 I get
> a point which is not at half-a-distance from the first point of the
> curve, and this is wrong to me. So, how should I divide the curve in x
> segments with equal length? I have checked this group but it's not yet
> clear to me how to do. Any help? Any function returning xyz coords by
> passing a linear t parameter (based on the whole length of the curve)
> would be greatly welcome. Thank you.

Look at
http://www.geometrictools.com/Documentation/MovingAlongCurveSpecifiedSpeed.pdf
My Curve2 and Curve3 classes have an implementation of the ideas
in this document.  You choose the arclength s of interest, and then
compute the corresponding curve parameter t that gets you to that
arclength.

--
Dave Eberly
http://www.geometrictools.com

``` 0 5/18/2007 5:23:09 AM
 Reply: Similar Artilces:

Help offsetting cubic Bezier with another cubic Bezier
I have two curves both constructed by cubic Beziers. One is a quarter sine wave from 0 to pi/2 the other acts as the offset profile and is the right upper quadrant of an ellipse. Can this be done? Mark Szlazak writes: > I have two curves both constructed by cubic Beziers. One is a quarter > sine wave from 0 to pi/2 the other acts as the offset profile and is > the right upper quadrant of an ellipse. Can this be done? A bit confusing what you're describing. But the shapes you mention can be approximated to arbitrary precision by Bezier curves, yes. Richard J Kinch <nobody@nowhere.com> wrote in message news:<Xns94F0B61CA8CCsomeconundrum@216.196.97.131>... > Mark Szlazak writes: > > > I have two curves both constructed by cubic Beziers. One is a quarter > > sine wave from 0 to pi/2 the other acts as the offset profile and is > > the right upper quadrant of an ellipse. Can this be done? > > A bit confusing what you're describing. But the shapes you mention can be > approximated to arbitrary precision by Bezier curves, yes. I don't want to do this by adding equations then constructing a Bezier out of them, but by manipulating -- via some general algorithm -- the control polygon of one (i.e., points and handles in Illustrator or Freehand) in some way given the control polygon of a profile that I want to use as an offset. I hope the term "offset" is the correct in this case, using "adding&qu...

Determining segment of cubic bezier
Hi - I'm trying to figure out how to create a segment of a cubic bezier, given a start point t0, and an endpoint t1. I've been banging my ahead against de Casteljau for a while, but I can't seem to figure out how to use it for this purpose. To restate my question, how can I create a new cubic bezier curve C1, which is equivalent to the segment of curve C0 defined by parameters t0 and t1 on C0? Thanks in advance... To answer my own question, Peter Zin's answer in this thread proved to be what I was looking for... http://groups.google.com/group/comp.graphics.algorithms/browse_thread/thread/93f66a3f554f5249/771d2a153f3d5980 gerhans@gmail.com wrote: > Hi - I'm trying to figure out how to create a segment of a cubic > bezier, given a start point t0, and an endpoint t1. I've been banging > my ahead against de Casteljau for a while, but I can't seem to figure > out how to use it for this purpose. That really should be straightforward: use de Casteljau once to subdivide your input spline at its point t0, and then once more to subdivide the right part at the new parameter t1' that corresponds to former t1. The only part that might be a bit tricky is to find t1'. That amounts to a numeric approximation to find the t1' that maps to the same point as t1 did on the original curve. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain. "Gerhans" <gerhans@gmai...

Dividing row at another equal in length rows
Dear Members, I need your to write a function which will partition rows at another equal in length rows. For example if I have the row X = [5 4 3 2 5 10 11 1 9 7] I'd like to partition it at 5 another rows X1 = [5 4] X2 = [3 2] X3 = [5 10] X4 = [11 1] X5 = [9 7] or at 2 rows X1 = [5 4 3 2 5] X2 = [10 11 1 9 7], i.e the number of rows is adjustable parameter (N) To solve the problem I do the following: 1. Define the number of elements in the rows l = length(X); i = l/N; i=floor(i); 2. Define the first and the last elements for each row for j = 1:N y(j) = (j-1)*i+1; ...

Subdivide cubic bezier segment at specified position
Greetings all. First of all, let me say that I am not really a programmer, and many of the algorithms and subjects discussed here are over my head. I try very hard to learn what I can and not ask well answered questions, but I'm more of a designer, so these things come slow. Any help here would be greatly appreciated. Here's what I'm trying to do: http://abeall.com/files/temp/subdivide.bezier.gif 1) A single bezier segment(p1,c1,c2,p2) is divided into two bezier segments. 2) The new point added along the bezier segment has two control points(preceding and succeeding) so the bezier curve's shape is not altered. 3) The original bezier curve control points are adjusted so that the bezier curve's original shape is not altered. Now, knowing nothing about Bezier math a few days ago, here's what I believe I've determined from my research: 1) You can easily determine a point along a bezier curve at a given time, from 0-1, using a well known formula 2) You cannot easily determine a point along a bezier curve at a give distance from an existing point. You must approximate by walking the curve at small time intervals. 3) I have no idea how you would determine new control points from any point along a bezier curve. Ultimately, I'm attempting to write an extension for an application already withcubic bezier curves, which removes a point and rounds it off by a specified radius. The application's API allows for adding a point along a bezier segment(d...

2D intersection algorithm for cubic bezier curves... who has one?
Hi all, does anyone know where I might find an algorithm for determining the intersections (numerical, not analytical) for two 2D cubic bezier curves, worked out as source code in a relatively common programming language? I've spent a few hours reading through several papers that discuss how one might determine the intersections for bezier curves, without them actually giving any concrete code that does what the papers talk about. If anyone has example code that does this trick (I'm sure plenty of people on this newsgroup have such code lying around, or know where to get it) in a relatively common and understandable programming language (but please, no VB), I would be most appreciative if I could have a look at it. Ideally I'm looking for something like the code that's used by Tomoyuki Nishita's java applet for determining insections (he uses Bezier Clipping, but after a few hours of googling for "bezier clipping" I'm not really anywhere nearer to having found an actual implementation that tells me how the code works, rather than what the motivation behind using the procedure that results in whatever code that ended up being used!). Please, no "this is the math behind it, now write it yourself" solutions, it's a problem that's been tackled enough times over the course of the last three decades to have some kind of standard source code solution by now (plus, I'm not good enough at analytical math to convert a theoret...

Selecting a specific number of rows and Dividing data into segments of the same length
I have several hundred thousands data in one column in MyData.mat file, each measurement was recorded in a specific time. I can read the time of each measurement, e.g.: datestr(MyData(10),'dd-mm-yyyy HH:MM:SS AM'); and I got answer in 10th row the time of measurement was 10-01-2012 12:10:04 PM Let's say I want to recall only 32 seconds out of these data, e.g. 12:21:07 til 12:21:39 PM. How can I do it? By now I found I could just recall the rows which contain these 32 seconds (12:21:07-12:21:39 PM), e.g.: X=MyData(144:1220,1); but it takes lots of time to identify the rows of my interest. Is there any easier way/commend to recall the data by the time, eg. start 12:21:07, finish 12:21:39? I have tried to use logical indexing but I haven't found any solution yet. Then, my another problem is, I need to divide these 32 seconds into 2.56 seconds segments. I have tried to use C = mat2cell. It works if I specify the parameters (number of rows ), but Im looking for some other general function that divides different length of data (e.g. 32 seconds -as above, 40 seconds, 35 seconds, 41 seconds etc) always in small segments of 2.56 seconds, without setting different parameters (number of rows , submatrices) each time. Sampling frequency was 100 Hz Does anybody have any idea and could help me, please? On Monday, November 18, 2013 12:30:12 PM UTC+13, swinnn wrote: > I have several hundred thousands data in one column in MyData.mat file, e= ...

Cubic B-Spline to Cubic Beziers
Hello - I am working with closed, uniform cubic b-splines and attempting to render them in Java as cubic beziers. My understanding is that such a conversion is possible, but my grasp of the underlying mathematics rapidly breaks down from there. I have a vague geometric picture of what must go on via blossoming(?) and have found code that does the job properly for >= 6 control points in the book _Computer Graphics Using Java 2D and 3D_. However that book's code seems to fail in the case of 4 or 5 control points. I have addressed the case of 4 control points as that seems to just be equivalent to the cubic bezier, but things fall apart when I have 5 control points. I am reproducing here the code that I'm working from (I trust that is alright given the fact that the same code is available via Google books). If anyone can help me adapt this code to address the case of 5 CVs I would be incredibly grateful. public GeneralPath CubicBSplineToGeneralPath( BSpline2f spline ) { GeneralPath path = new GeneralPath(); float x1, y1, x2, y2, x3, y3, x4, y4; Vec2f p1, p2, p3, p4; Vec2f pts[] = spline.getControlPoints(); int n = pts.length; if (n <= 3) { return path; // illegal anyway } else if( n == 4 ) { path.moveTo( pts.x, pts.y ); path.curveTo( pts.x, pts.y, pts.x, pts.y, pts.x, pts.y ); return path; } else if( n == 5 ) { // WHAT HAPPENS HERE? } // this functions properly when n >= 6 p1 = pts; path.moveTo( p1....

Re: bezier-bezier intersection 2D algorithm
"Pascal Scanu" <Pascal.Scanu@atemi.fr> wrote in message news:<bkm583\$arq\$1@s1.read.news.oleane.net>... > Try http://www1.acm.org/pubs/tog/GraphicsGems/gemsiv/curve_isect/ (from > Graphics Gems IV) > > "db501" <db501@torfree.net> a �crit dans le message de > news:hHQab.4115\$mv6.697001@news20.bellglobal.com... > > How I could find out who is selling 2D Bezier-Bezier intersection source > > code. Quadratic Beziers. > > > > After testing the above Graphic Gems Bezier-Bezier intersection algorithm I discovered it dosn&#...

Quad Bezier curves to Cubic bezier curves.
Hi all, Hope this is th right group fro this question. I'm writing a java program that needs to convert some quadratic bezier curves to cubic bezier curves. I hope this is possible... I'm a strong programmer but its been a while since if been in a math class so its not obvious to me how to do this. Can anyone point me in the right direction? Also is it even possible to do this. Thanks. Glen "Glen Pepicelli" <lpepicel@nycap.rr.com> wrote in message news:wv9ke.15389\$tM3.42@twister.nyroc.rr.com... > I'm writing a java program that needs to convert some quadratic bezier > curves to cubic bezier curves. I hope this is possible... I'm a strong > programmer but its been a while since if been in a math class so its not > obvious to me how to do this. This is called "degree elevation". A degree n Bezier curve is X(t) = sum_{j=0}^{n} P[j]*c(n,j)*pow(t,j)*pow(1-t,n-j) where c(n,j) = n!/(j!*(n-j)!). The degree n+1 Bezier curve is X(t) = sum_{j=0}^{n+1} Q[j]*c(n+1,j)*pow(t,j)*pow(1-t,n+1-j) where Q = P, Q[n+1] = P[n], and Q[j] = (j/(n+1))*P[j-1] + (1 - j/(n+1))*P[j] for 1 <= j <= n. This topic can be found, for example, in G. Farin's book "Curves and Surfaces for Computer Aided Geometric Design". -- Dave Eberly http://www.geometrictools.com That was fast. Thanks very much. Dave Eberly wrote: > "Glen Pepicelli" <lpepicel@nycap.rr.com...

Cubic Bezier
A cubic bezier, definition in P0, P1, P2 and P3. When P2 equal to P3, to not change bezier curve shape, should how calculate the P1 value? Thanks. Hi Jack, You can't because the initial definition _can_ have up to one minima and one maxima (not including the end points). In fact in the case where p2 is equivalent to p3 then you're looking at a quadratic bezier curve, which inherently will have different curve characteristics. Arash Partow ________________________________________________________ Be one who knows what they don't know, Instead of being one who knows not what they don't know, Thinking they know everything about all things. http://www.partow.net Jack, You can't because the initial definition _can_ have up to one minima and one maxima (not including the end points). In fact in the case where p2 is equivalent to p3 then you're looking at a quadratic bezier curve, which inherently will have different curve characteristics. Arash Partow ________________________________________________________ Be one who knows what they don't know, Instead of being one who knows not what they don't know, Thinking they know everything about all things. http://www.partow.net On 27 Dec 2005 01:43:58 -0800, "Arash Partow" <partow@gmail.com> wrote: >You can't because the initial definition _can_ have up to one minima >and one maxima (not including the end points). In fact in the case >where p2 is equivalent to p3 t...

Graphic Equalizer
I want to implement a graphic equalizer in S/W. I assume it is a bunch of bandpass filters with boost/cut at thei respective frequencies. Has anyone else done this or know of any links? for a parametric EQ (tuneable center freuquency and quality factor), see http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt -mn On Nov 4, 11:30 pm, "Stacy" <stacy2003_yo...@yahoo.com> wrote: > I want to implement a graphic equalizer in S/W. > I assume it is a bunch of bandpass filters with boost/cut at their > respective frequencies. > > Has anyone else done this or know o...

Algorithm of segmentation
Hi, I'm searching an algorithm of segmentation for a biological application. This algorithm of segmentation must be able to segment a picture which contains several cells (for example from 20 to 30). This algorithm must give too different parameters like the area, the circularity etc. Thank you. ...

Is the length of a picture string always equal to the length of the string DISPLAYed?
The context here is writing a tool to perform analysis on COBOL source code. Assume that when I load the source code into memory, I do some preprocessing so that picture strings like "X(6)" never occurs. For example, perhaps I will always expand repeat-factors so in some earlier stage so that the later analysis stages see "XXXXXX" instead of "X(6)". Suppose you have a picture string like "\$\$,\$\$9.99" which contains 9 characters. Regardless of what data the item with this picture string contains, when I try to DISPLAY it, the output displaye...

equal and not equal
how translate = and /= for pointer use? and := ? > how translate = and /= for pointer use? > and := ? What do you mean by "for pointer use"? Florian Weimer wrote: >>how translate = and /= for pointer use? >>and := ? > > What do you mean by "for pointer use"? And what do you want to translate from, and what do you want to translate to? -- Bj�rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu TC a �crit : > how translate = and /= for pointer use? > and...

DivIDE / DivIDE+
Hihi Is anyone actually selling the DivIDE/DivIDE+ currently? Mine had a bit of an accident so needs replacing, kit form is fine if assembled ones aren't available... Also, does anyone know where I might acquire a Multiface 128 (+D) and a Multiface 3? Thanks -- Adam Adam wrote: > Hihi > > Is anyone actually selling the DivIDE/DivIDE+ currently? > > Mine had a bit of an accident so needs replacing, kit form is fine if > assembled ones aren't available... As far as I know, no. However, it looks like the only non-standard part currently unavailable from http://...

Why are my lengths not equal?
I am trying to develop a plot of four approximations and compare them to each other on the same plot using delta t = 4,2,1,0.5. I am just doing one for dt = 1 to write and then will add the others in once I got it working. When I run my code, I get an error when it goes to plot that says the length of (t) and the length of (Y) are not equal. I am really not sure how to fix it. dt = [ 1 ]; tend = 10; t = 1:dt:tend; g = 9.8; Y(1) = 0; Vy(1) = 100; for i = 1:length(dt) for n = 1:length ((t)-1) Y(n+1) = Vy(n) * dt + Y(n) Vy(n+1) = Vy(n) - g * dt end end le...

How to multiply or divide 2 vector of same length and obtain a vector of same length
Is there any build in VI which could do that?&nbsp; I am looking for a way to divide 2 array of same length and would give me another array (same length) [1 3] / [2 4] = [1/2 3/4] Thx All the linear algebra operations are on the "Analyze...Mathematics...Linear Algebra palette" (LabVIEW 7.1 and below). If you have LabVIEW LabVIEW 8.0, there is a new matrix data type which will use linear algebra operations directly if you wire them to e.g. a multiply node. Check the online help for details. ...

divider algorithm
Hello I am currently working on a block where i need to divide the 16-bit byte address by 5 to generate the 5-byte aligned address for the internal RAM. I started off by using an actual divider (ie five_byte_ram_addr <= byte_ram_adder /5). However, this is expensive in terms of area and does not meet timing. Can anyone point me to some algorithms which detail how to approximate the divider functionality (and in particular in this instance an alogorithm which alllows approximation of divide by 5)? Thanks in advance. JO thunder wrote: > Hello > > I am curre...

ABOUT DIVIDE BY ZERO_________GENETIC ALGORITHMS
HI EVERYBODY, i use gatool and i have a project. my fitness function runs clearly. but at the ga part, there is an error. in the makestate.m function; [state,options] = gaoutput(FitnessFcn,options,state,'init'); when executing this row ga gives: Warning: divide by zero after that in the gadsswitchyard.m function; if nargout==0 feval(action,varargin{:}); else [varargout{1:nargout}]=feval(action,varargin{:}); end at the end of the last row, ga gives: Warning: Divide by zero.Subscript indices must either be real positive integers or logicals. how can i solve this problem. please he...

Algorithm of histogram equalization
Can anyone explain a general formula to me, how to do histogram equalization. I know, there is histeq command in Matlab, but I need the algorithm of that. luke wrote: > > > Can anyone explain a general formula to me, how to do histogram > equalization. I know, there is histeq command in Matlab, but I need > the algorithm of that. > Why not just look it up? In Gonzales-and-Woods for example. Anyway this is what I use. (For convenience I also always cast my images to doubles.) [qa,qs] = hist(in_img(:),hist_lim); qs = [min(in_img(:)) qs(1:end-1)/2+qs(2:end)/2 max(in_img(:))]...

Divide data into segment
Hello, I want to divide a time-series data into segments. The data arrangement should not unchanged. As an example, i have 20 data. I want to divide them into 4 segment. So, the first segment should contain data 1- data20.. Please help. I'm not very familiar with Matlab. Thanks in advance.. On 3/16/2011 8:46 PM, Dovon wrote: > Hello, > > I want to divide a time-series data into segments. The data arrangement should not unchanged. > > As an example, i have 20 data. I want to divide them into 4 segment. So, the first segment > should contain data 1- data20.. > > Please help. I'm not very familiar with Matlab. Thanks in advance.. Do you just mean to break a squence like this: ------------------------------- N = 10; %length of sequence number_segments = 5; time_series = 1:N; B = reshape(time_series,N/number_segments,number_segments)'; -------------------------- time_series = 1 2 3 4 5 6 7 8 9 10 B = 1 2 3 4 5 6 7 8 9 10 --Nasser Got it!!Thanks.. ...

multiply/divide algorithm
Hi, I was assigned a task to finish some algorithm with multiply and divide with signed floating data in ASIC. I wonder if I can use "*" or "/" directly in verilog and I don't know how many clocks it will cost until I get the result. Since this task will be verified through FPGA, I can't infer DW directly. Can any body give me the answer? thanks very much. regards chen yong FPGA's have built in multipliers and also you can choose the latency, so thats not an issue but divide if not in powers of two should be designed explicitlly by you. well, the problem is that the design will be transfered to ASIC. So i have to find some way which could be used at both situation. The big question is with your synthesis. If your synthesis tool is targeted to the ASIC and its available libraries, it's possible the multiply and divide could be implemented with those operators. Your synthesizer should have a reference that includes synthesis language support. It's in this section that I find details for FPGAs but I don't know about your ASICs. "skyworld" <chenyong20000@gmail.com> wrote in message news:1124862365.814929.103790@g47g2000cwa.googlegroups.com... > Hi, > I was assigned a task to finish some algorithm with multiply and divide > with signed floating data in ASIC. I wonder if I can use "*" or "/" > directly in verilog and I don't know how many clo...

subdividing a bezier-segment
Given a cubic bezier-segment defined by four control points, I would like to divide it at a parameter value in the range [0;1], and obtain two cubic bezier-segments which when pieced together have the equal shape as the original segment. Can anybody provide me with the formulas for the eight new control-points? David Romstad david.romstad@mail.dk wrote: > Given a cubic bezier-segment defined by four control points, I would > like to divide it at a parameter value in the range [0;1], and obtain > two cubic bezier-segments which when pieced together have the equal > shape as the original segment. Can anybody provide me with the formulas > for the eight new control-points? > Our FAQ: http://cgafaq.info/wiki/Bezier_Splitting Przemek -- "Beauty is the first test: there is no permanent place in the world for ugly mathematics." G.H. Hardy Przemyslaw Koprowski skrev: > Our FAQ: > http://cgafaq.info/wiki/Bezier_Splitting > > > Przemek > > -- > "Beauty is the first test: there is no permanent place > in the world for ugly mathematics." G.H. Hardy I have tried to implement bezier-splitting according to the FAQ, and its working nicely. I have also used it on a qubic bezier-patch with 16 control points, using the algorithm on every of the four rows, and it seems to be working there too. David Romstad ...

How to write an algorithm for an equalizer?
Hi, I want to implement an DFE equalizer which is custom one different with that Matlab provided. I would calculate the coefficients by myself. I don't find that I can disable LMS or RLS by parameter settings. So, I have to write an algorithm although it isn't adaptive. The problem is that I don't know the requirements of equalizer DFE to the algorithm. Can anyone tell me how to solve the problem? Thanks in advance. ... Web resources about - Divide Cubic Bezier into equal length segments - comp.graphics.algorithms Anterior segment of eyeball - Wikipedia, the free encyclopedia
Diagram of anterior segment of a human eye ( horizontal section of the right eye) 1. Lens , 2. Zonule of Zinn or ciliary zonule , 3. Posterior ... Facebook Concert Discovery App Bandsintown Divides Music Fans Into Five Segments
... enthusiasts and active users of the social network between the ages of 16 and 59, and it used its findings to divide the group into five segments: ... For US Hispanic Marketers, New Language-Based Targeting Segments
Today we’re launching new language-based targeting segments designed to help advertisers with Hispanic marketing efforts in the US deliver more ... segments - Flickr - Photo Sharing!
8 meter long tapeworm (!!!) at the Meguro Parasitological museum, in the Meguro neighborhood of Tokyo, Japan. VIDEO GAMES LIVE Civilization IV segment from DVD, Blu-Ray & CD - YouTube
This is the Video Games Live Civilization IV segment written by Christopher Tin. We entitled this piece Civilization IV - Baba Yetu (Duet Version). ... The Daily Show segment about Australians and Gun Control wins an Emmy
Former politicians John Howard, Tim Fischer and Rob Borbidge aren't the first names which spring to mind when you think of TV's annual Emmy Awards. ...

Resources last updated: 3/8/2016 3:04:30 AM