如何在NURBS曲面中连接控制点?

时间:2013-01-26 18:50:31

标签: maya nurbs

我正在尝试学习如何处理项目的NURBS曲面。基本上我不想用NURBS在一些3D程序中构建几何体,然后导出几何体,并用它运行一些模拟。我已经找到了NURBS曲线,我确实认为我主要理解曲面是如何工作的,但我不知道的是控制点是如何连接的。显然你不像多边形那样需要任何拓扑矩阵?当我从Maya导出NURBS曲面时,文件格式为.ma,这是纯文本文件,我可以看到结矢量,然后只是一个点列表。没有拓扑信息。这是如何运作的?如何在不知道点如何相互连接的情况下重建NURBS曲面?导出的文件写在下面:

//Maya ASCII 2013 scene
//Name: test4.ma
//Last modified: Sat, Jan 26, 2013 07:21:36 PM
//Codeset: UTF-8
requires maya "2013";
requires "stereoCamera" "10.0";
currentUnit -l centimeter -a degree -t film;
fileInfo "application" "maya";
fileInfo "product" "Maya 2013";
fileInfo "version" "2013 x64";
fileInfo "cutIdentifier" "201207040330-835994";
fileInfo "osv" "Mac OS X 10.8.2";
fileInfo "license" "student";
createNode transform -n "loftedSurface1";
    setAttr ".t" -type "double3" -0.68884794895562784 0 -3.8172687581953233 ;
createNode nurbsSurface -n "loftedSurfaceShape1" -p "loftedSurface1";
    setAttr -k off ".v";
    setAttr ".vir" yes;
    setAttr ".vif" yes;
    setAttr ".covm[0]"  0 1 1;
    setAttr ".cdvm[0]"  0 1 1;
    setAttr ".dvu" 0;
    setAttr ".dvv" 0;
    setAttr ".cpr" 4;
    setAttr ".cps" 4;
    setAttr ".cc" -type "nurbsSurface" 
        3 3 0 0 no 
        8 0 0 0 1 2 3 3 3
        11 0 0 0 1 2 3 4 5 6 6 6

    54
    0.032814107781307778 -0.01084889661073064 -2.5450696958149557
    0.032814107781308312 -0.010848896610730773 -1.6967131305433036
    0.032824475105651972 -0.010848896610730714 -0.0016892641735144487
    0.032777822146102309 -0.01084889661073018 2.5509821204222565
    0.032948882997777158 -0.010848896610730326 5.3256822304677218
    0.032311292550627417 -0.010848896610730283 7.5033561343333179
    0.034690593487551526 -0.010848896610730296 11.39484483093603
    0.014785648001686571 -0.010848896610730293 11.972583607988943
    -0.00012526283089935193 -0.010848896610730293 12.513351622510489
    0.87607723187763198 -0.023973071493875439 -2.5450696958149557
    0.87607723187766595 -0.023973071493876091 -1.6967131305433036
    0.87636198619878247 -0.023973071493875821 0.00026157734839016289
    0.87508059175355446 -0.023973071493873142 2.5441541750955903
    0.87977903805225144 -0.023973071493873861 5.3510431702524812
    0.86226664730269065 -0.02397307149387367 7.4087403205209448
    0.9276177640022375 -0.023973071493873725 11.747947146400762
    0.39164345444212556 -0.023973071493873704 12.72679599298271
    -0.003344290659457324 -0.023973071493873708 13.356608602511475
    2.7585407036097025 0.080696275184513055 -2.5450696958149557
    2.7979735813230628 0.036005680442686323 -1.6988092981025378
    2.7828331201271896 0.05438167150027777 0.0049374879309111996
    2.6143679292284574 0.23983328019207673 2.5309327393956176
    2.67593270347135 0.19013709747074492 5.3992530024698517
    2.5981387973985108 0.20347021966427298 7.2291224273514345
    2.8477496474469728 0.19983391361149261 12.418208886861429
    1.1034136098865515 0.20064198162322153 14.474560637904968
    -0.010126299867110311 0.20064198162322155 15.133224682698101
    4.5214126649737496 0.45953483463333544 -2.5450696958149557
    4.6561826938778452 0.23941045408996731 -1.7369291398229287
    4.6267725925384751 0.29043329565744253 0.025561242784985394
    3.9504978751410711 1.3815767918640129 2.5159293599869446
    4.1596851721552888 1.0891788615080038 5.438642765250469
    3.9992107014958198 1.1676270867254697 7.0865667556376426
    4.4319212871194775 1.1462321162116154 12.949041810935984
    1.6384310220676352 1.1509865541035829 15.927795222282771
    -0.015643773215464073 1.1509865541035829 16.578582772395933
    5.2193823159440154 3.0233786192453191 -2.5450696958149557
    5.2193823159440162 3.0233786192453196 -1.6967131305433036
    5.2218229691816047 3.0233786192453191 0.0091618497226043649
    5.2108400296124504 3.0233786192453196 2.5130032217858407
    5.251110808032692 3.0233786192453191 5.4667467111172652
    5.1010106339208772 3.0233786192453191 6.9770771103715621
    5.6611405519478906 3.0233786192453205 13.358896446133507
    2.0430537629341199 3.0233786192453183 17.059047057656215
    -0.019924192630756767 3.0233786192453191 17.6998820408444
    5.1365144716134976 5.4897102753589557 -2.5450696958149557
    5.1365144716134994 5.4897102753589566 -1.6967131305433036
    5.1389093836131625 5.4897102753589566 0.0089946049919694682
    5.1281322796146718 5.4897102753589566 2.5135885783430627
    5.1676483276091361 5.4897102753589548 5.4645725296190131
    5.0203612396297714 5.4897102753589566 6.9851884798073476
    5.5699935435527692 5.4897102753589566 13.328625149888618
    2.0133428487217855 5.4897102753589557 16.975388787391935
    -0.01960785732642523 5.4897102753589557 17.617014800296868

    ;
select -ne :time1;
    setAttr ".o" 1;
    setAttr ".unw" 1;
select -ne :renderPartition;
    setAttr -s 2 ".st";
select -ne :initialShadingGroup;
    setAttr ".ro" yes;
select -ne :initialParticleSE;
    setAttr ".ro" yes;
select -ne :defaultShaderList1;
    setAttr -s 2 ".s";
select -ne :postProcessList1;
    setAttr -s 2 ".p";
select -ne :defaultRenderingList1;
select -ne :renderGlobalsList1;
select -ne :hardwareRenderGlobals;
    setAttr ".ctrs" 256;
    setAttr ".btrs" 512;
select -ne :defaultHardwareRenderGlobals;
    setAttr ".fn" -type "string" "im";
    setAttr ".res" -type "string" "ntsc_4d 646 485 1.333";
select -ne :ikSystem;
    setAttr -s 4 ".sol";
connectAttr "loftedSurfaceShape1.iog" ":initialShadingGroup.dsm" -na;
// End of test4.ma

2 个答案:

答案 0 :(得分:0)

NURBS曲面在拓扑上是正方形的,在u方向上具有度数+跨度,在v方向上具有(度-1)+跨度+ 1 *。 (单个NURBS曲面就像多边形的一个面只更复杂)

“。cc”中的前2个属性是方向的度数,接下来的两行定义了每个单独的值代表跨度的结。重复只是权重,因此重复x次:

8 0 0 0 1 2 3 3 3

意味着有8节(在这种情况下是U方向),0 1 2 3个跨度,总共6个点,因此它是U方向上的第三度单跨度曲线。该示例在V方向上具有9个点,因此7 * 9 =总共54个点

然而,这还不够,因为NURBS甚至可以远程使用。您必须实现修剪曲线,这些曲线是位于曲面的UV参数化上的曲线,它们可以将单个NURBS剪切为不同的形状。

在实践中,然而可能用户依赖于手动绗缝。 Quilts **是网格的高阶NURBS等价物,大多数nurbs建模者都将其用作概念。为了处理这些,它通常不足以具有修剪曲线。由于修剪曲线无法在应用之间可靠地传输,无需缝制。因此,许多应用程序依赖于实际告知所述表面到表面被子集合的地形连接的空间历史。因此,要准备好自己的交叉算法等,以获得任何有意义的NURBS兼容性。

有关数学基础信息的更多信息,请参阅Wikipedia,wolfram等。

*如果我没记错的话。

**由于在几个不同语言区域同时发现,被子在不同的应用程序中具有不同的名称。

答案 1 :(得分:0)

NURBS曲面的CV总是在网格中布局。可以使用表面的程度和每个方向上的结数来计算nurbs表面中的CV的数量。然后,CV仅以某种特定顺序呈现,通常是行主要。

让我们来看看你的例子。我大多只是猜测格式,所以你要检查我的假设。

3 3 0 0 no

看起来你有一个双三次曲面。它在任何一个方向上都不是周期性的(也就是说,你有一张纸而不是一个圆柱或圆环)。你的简历是非理性的,意思是它们是[x,y,z]而不是[xw,yw,zw,w]。

换句话说,第一行的格式似乎是:

[degree in s] [degree in t] [periodic in s] [periodic in t] [rational]

接下来,一个结矢量具有8个结值,另一个具有11.对于3度非周期性nurbs,CV的数量是num_knots - 2.因此,在该表面中有6 x 9个CV。

前6个CV位于第一行。接下来的6个是在下一行等等。

如果您正在寻找有关NURBS的更多信息,我建议您使用this text作为理论。对于maya特定的东西,它们在maya API中有一些不错的文档。

相关问题