รายละเอียด :
สถานะ :
v0.1.4-alphaมุ่งเน้นไปที่ทุกประเด็นที่มีส่วนร่วมตาม PEP440
แพ็คเกจทั้งหมด : เผยแพร่
การเปลี่ยนแปลงทดสอบบน Python 3.10, Windows 10
การเพิ่มประสิทธิภาพ สำหรับเสียงอ็อกเทฟ
การทดสอบ หน่วยการทดสอบ
การเขียน เอกสาร API
การเขียน เอกสารที่รอดำเนินการ
การเขียน readthedocs
การเขียนบล็อก
เสร็จสิ้น เอกสารในรหัส ที่เหลืออยู่
octaves มิติ
ภาพหน้าจอ :










Python>=3.10.0 สำหรับการพึ่งพาการผลิตดูข้อกำหนด
สำหรับการพึ่งพาการพัฒนาโปรดดูการตอบโต้
$ pip install nPerlinNoiseสำหรับคำแนะนำโดยละเอียดเกี่ยวกับการติดตั้งดูการติดตั้ง
การตั้งค่า
import NPerlinNoise as nPN อ้างอิง #24 >>> import nPerlinNoise as nPN
>>> noise = nPN.Noise( seed = 69420 )การใช้งานขั้นพื้นฐาน
รับค่าเสียงรบกวนที่พิกัด N-dimensional โดยการโทรไปที่ noise(...)
พิกัดอาจเป็นค่าเดียวหรือซ้ำได้
เสียงรบกวน (... , l, m, n, ... )
โดยที่ l, m, n, ... เป็นค่าเดียว
>>> noise( 73 )
array(0.5207113, dtype=float32)
>>> noise( 73 , 11 , 7 )
array(0.5700986, dtype=float32)
>>> noise( 0 , 73 , 7 , 11 , 0 , 3 )
array(0.5222712, dtype=float32)Noise (.... , [L1, L2, ... , LX], [M1, M2, ... , MX], [N1, N2, ... , NX], .... )
ที่ไหน .... , การวนซ้ำของ dimensions homogeneous และ lx, mx, nx, ... เป็นค่าเดียวที่เอาต์พุตจะมีรูปร่างเหมือนกันของอินพุต homogeneous-dimensions
>>> noise([ 73 , 49 ])
array([0.52071124, 0.6402224 ], dtype=float32)
>>> noise([ 73 , 49 ], [ 2 , 2 ])
array([0.4563121 , 0.63378346], dtype=float32)
>>> noise([[ 73 ], [ 49 ], [ 0 ]],
... [[ 2 ], [ 2 ], [ 2 ]],
... [[ 0 ], [ 1 ], [ 2 ]])
array([[0.4563121 ],
[0.6571784 ],
[0.16369209]], dtype=float32)
>>> noise([[ 1 , 2 ], [ 2 , 3 ]],
... [[ 1 , 1 ], [ 1 , 1 ]],
... [[ 2 , 2 ], [ 2 , 2 ]])
array([[0.08666219, 0.09778494],
[0.09778494, 0.14886124]], dtype=float32) noise(..., l, m, n, ...) มีค่าเดียวกันกับขนาดต่อท้ายที่มีศูนย์เป็นพิกัด
เสียงรบกวน (... , l, m, n) = เสียง (... , l, m, n, 0) = เสียงรบกวน (... , l, m, n, 0, 0) = เสียงรบกวน (... , l, m, n, 0, 0, 0, ... )
>>> noise( 73 )
array(0.5207113, dtype=float32)
>>> noise( 73 , 0 )
array(0.5207113, dtype=float32)
>>> noise( 73 , 0 , 0 )
array(0.5207113, dtype=float32)
>>> noise( 73 , 0 , 0 , 0 , 0 )
array(0.5207113, dtype=float32) โหมดกริดช่วยให้สามารถคำนวณเสียงรบกวนสำหรับการรวมกันของ coords ทุกครั้ง
ใช้ noise(..., gridMode=True) gridmode เป็นอาร์กิวเมนต์คีย์คำเท่านั้น, default = false
เอาต์พุตจะมีรูปร่างเท่ากับความยาวของ coords ในลำดับนั้น
>>> noise([ 73 , 49 ], [ 2 , 2 ], [ 0 , 1 ], gridMode = True )
array([[[0.4563121 , 0.63378346],
[0.4563121 , 0.63378346]],
[[0.44594935, 0.6571784 ],
[0.44594935, 0.6571784 ]]], dtype=float32)
>>> noise([ 1 , 20 , 32 , 64 ], [ 1 , 1 , 2 ], 0 , [ 1 , 2 ], gridMode = True )
array([[[[0.06459193, 0.5110498 , 0.669962 , 0.47636804],
[0.06459193, 0.5110498 , 0.669962 , 0.47636804],
[0.09864856, 0.5013973 , 0.62935597, 0.47954425]]],
[[[0.07678645, 0.50853723, 0.6778991 , 0.4679888 ],
[0.07678645, 0.50853723, 0.6778991 , 0.4679888 ],
[0.14069612, 0.47582665, 0.6663638 , 0.48764956]]]],
dtype=float32)สำหรับการใช้อย่างละเอียดดูตัวอย่าง
เพื่อดูการทดสอบทั้งหมดดูการทดสอบ
No Known BugsNPerlin.findBounds is bottlenecknoise(a, b, c, d, e, f, ...) is slow for single value coordinatesหากคุณมีคำถามข้อกังวลรายงานข้อผิดพลาด ฯลฯ โปรดยื่นปัญหาในตัวติดตามปัญหาของที่เก็บนี้หรือเปิดการอภิปรายในส่วนการสนทนาของที่เก็บนี้
Looking for Contributors for feature additionsLooking for Contributors for optimization #11Looking for Contributors for unit testing #12Looking for Contributors for ReadTheDocs #13Looking for Contributors for WebApp #14Looking for Contributors for API docs #15คำแนะนำทั่วไปเกี่ยวกับ วิธี การมีส่วนร่วมในการมีส่วนร่วมและจรรยาบรรณ
ผู้ดูแล :
| Amith M |
ผู้มีส่วนร่วม :
| Shravan Revanna |