在几何曲面上生成随机点(二维或三维)的库

random-geometry-points的Python项目详细描述


Build StatusCoverage StatusPyPI versionPyPI pyversions

随机几何点

此模块提供类以在几何曲面上生成随机点。 这些点可以用作测试数据,例如模拟测量装置的测量。

安装

您可以使用PIP全局安装此模块

pip install random-geometry-points

或使用pipenv

cd <your project folder>
pipenv install random-geometry-points

基本用法

当前支持几何类型平面球体二维圆。 可以使用以下导入语句导入几何类。

fromrandom_geometry_points.planeimportPlanefromrandom_geometry_points.sphereimportSpherefromrandom_geometry_points.circle2dimportCircle2D

现在,可以在几何曲面上创建任意数量的随机点。

# create a plane object with n = (1, 0, 0), x0 = (0, 0, 0), d = 0 and radius = 10normal_vec=(1.0,0.0,0.0)ref_point=(0.0,0.0,0.0)plane=Plane(normal_vec,0.0,ref_point,10.0)# create and print 3 random points lying on the planerandom_plane_points=plane.create_random_points(3)print(random_plane_points)# example output: [(0.0, -2.058506783308933, -5.777518695971468), (0.0, 2.501766732323411, 6.740902158795952), (0.0, 7.846400008799242, 5.304670974614023)]
# create a sphere object with x = 1.0, y = -4.5, z = 3.3 and radius = 11.35sphere=Sphere(1.0,-4.5,3.3,11.35)# create and print 3 random points lying on the sphererandom_sphere_points=sphere.create_random_points(3)print(random_sphere_points)# example output: [(4.442124959724451, -1.593759345598388, -7.1176792530940025), (-7.102728837759106, -6.022944977793705, -4.500572028791214), (-10.190814503489936, -4.676727604583875, 5.1859846505890115)]
# create a circle object with x = 1.0, y = -4.5 and radius = 11.35circle=Circle2D(1.0,-4.5,11.35)# create and print 3 random points lying on the circlerandom_circle_points=circle.create_random_points(3)print(random_circle_points)# example output: [(4.057509245253113, -15.430422554283604), (2.2509595260473114, 6.780851043436018), (9.330996610075898, 3.2082420488010035)]

文档

请查看Wiki以获得更详细的描述。在这里,您可以获得有关如何使用几何类、几何参数的含义和错误处理的详细信息。

展开

更新包

pipenv update --dev setuptools wheel twine

更新setup.py

更新setup.py的内容,特别是版本信息。

提交并标记

提交更改并将其与新的版本标记一起推送。travis将在推送到主分支时自动运行测试用例。

构建源存档和构建分发

pipenv run python setup.py sdist bdist_wheel

部署到pypi或testpypi以首先测试事物

pipenv run twine upload --skip-existing --repository-url https://test.pypi.org/legacy/ dist/*

pipenv run twine upload --skip-existing dist/*

有用链接

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java调用Python函数作为TEID中的UDF   java Android。支持v4导入不工作   java如何影响具有静态属性的类   java如何在从glTexImage2D()分配后编辑纹理的像素颜色   javaspringboot+rediscache+@Cacheable适用于某些方法,而不适用于其他方法   java无法将动态Web模块方面从3.0更改为2.5   java如何在新选项卡中显示打印的文档?   java Google Cloud Endpoints API方法仅在删除用户参数时成功调用   java为什么我可以使用Stack<Double>但不能使用Stack<Double>?   java JDBC PreparedStatement似乎忽略了占位符   java如何设置JInternalFrame的标准图标化位置?   Java文件。copy()不复制文件   基于另一个类的java显示arraylist?   java Android Studio:错误:非法字符:'\u2028'   对象(Java)无法实例化类型映像?   javascript错误:飞行前响应的HTTP状态代码401无效   java确保泛型vararg参数具有相同的类型