clc
clear
close all
% step1: points and knots
load data_example
% step 2: create the spline
sp = spmak(knots,ctrlpoints');
fnplt(sp,[knots(5),knots(42)]);
axis off
axis equal
hold on
title 'you are a cow'
% step 3: get points on the curve
dt = knots(5):3:knots(42);
p = fnval(sp,dt);
plot(p(1,:),p(2,:),'.g')
% step 4: get dir draw normals
dp1 = fnder(sp);
dp = fnval(dp1,dt);
len = size(dt,2);
for i = 1:len
dir = dp(:,i);
scale = 1/sqrt(dir(1)^2+dir(2)^2);
dir = dir*scale;
plot([p(1,i),p(1,i)+dir(2)],[p(2,i),p(2,i)-dir(1)],'r');
end
没有合适的资源?快使用搜索试试~ 我知道了~
nurbs曲面拟合,采用nurbs算法
共4个文件
mat:2个
m:2个
5星 · 超过95%的资源 需积分: 5 7 下载量 79 浏览量
2023-11-03
08:26:26
上传
评论
收藏 3KB RAR 举报
温馨提示
nurbs曲面拟合,采用nurbs算法
资源推荐
资源详情
资源评论
收起资源包目录
nurbs曲面拟合,采用nurbs算法.rar (4个子文件)
nurbs曲面拟合,采用nurbs算法
nurbs
data_example.mat 1024B
matlabcow.m 603B
data_example.mat 1024B
matlabcow.m 603B
共 4 条
- 1
资源评论
- 普通网友2024-03-20#完美解决问题 #运行顺畅 #内容详尽 #全网独家 #注释完整
温柔-的-女汉子
- 粉丝: 629
- 资源: 3934
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功