We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from pycatia import catia from pycatia.mec_mod_interfaces.hybrid_shape import HybridShape from pycatia.in_interfaces.reference import Reference import numpy as np catia = catia() document = catia.documents.add("Part") part = document.part hybrid_bodies = part.hybrid_bodies new_hybrid_body = hybrid_bodies.add() new_hybrid_body.name = "Noisy_Plane" plane_origin = [0, 0, 0] plane_normal = [0, 0, 1] plane_size = 100 sampling_step = 10 points = [] for x in np.arange(-plane_size / 2, plane_size / 2, sampling_step): for y in np.arange(-plane_size / 2, plane_size / 2, sampling_step): points.append([x, y, 0]) points = np.array(points) mean = 0 std_dev = 2 noise = np.random.normal(mean, std_dev, points.shape) noisy_points = points + noise factory = part.hybrid_shape_factory for point in noisy_points: new_point = factory.add_new_point_coord(point[0], point[1], point[2]) new_hybrid_body.append_hybrid_shape(new_point) fill_surface = factory.add_new_fill() for point in new_hybrid_body.hybrid_shapes: fill_surface.add_bound(Reference(point.com_object)) new_hybrid_body.append_hybrid_shape(fill_surface) part.update()
hello! I tried to apply a Gaussian distribution to one plane and refit it to the plane, but there was a problem with part.update(). Please show me.
edit: corrected formatting of code
The text was updated successfully, but these errors were encountered:
You aren't creating a Plane here but a fill Surface. What you're trying to do here isn't going to work.
Plane
Surface
Is it HybridShapeFactory.add_new_plane_mean that you really want?
Sorry, something went wrong.
No branches or pull requests
hello!
I tried to apply a Gaussian distribution to one plane and refit it to the plane, but there was a problem with part.update(). Please show me.
edit: corrected formatting of code
The text was updated successfully, but these errors were encountered: