- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am currently trying to recreate an object that is essentially a 3D-histogram. This involves importing the point cloud (x,y,z) and using addByCenterRectangle to create rectangle sketches 3mm x 3mm on the XY plane. I then use the z-value in the point cloud to determine the extrusion distance, and then extrude. Here is an example of my "finished" product:
Now the problem is, when I create the sketches without the extrusions, they appear to be positioned as expected, as seen by the following example of just a few iterations of the loop (960 in total, so takes a long time):
However, when I access the profile of the sketch within each loop using sketch.profiles.item(sketch.profiles.count-1), the areaProperties.centroid are positioned absolutely incorrectly. Below is a graph showing the actual XY positions of each sketch and on top of them are the positions of the profiles. The total number of profiles is correct, just that they are duplicated.
So when I extrude using the latest profile in each loop, I get multiple extrusions in the same location, and not matching the original point cloud locations nor the original sketch locations.
Now, my "solution" to this was to make each rectangle slightly smaller (2.90mm instead of 3.0mm) so that the boundaries of each sketch do not overlap. This results in the correct placement of the sketches/profiles/extrusions, however with visible gaps in between each extrusion, which I do not want (looks bad when rendering).
I would like them to be next to each other and would result in a continuous shape with no gaps as if all the extrusions were apart of the same body. Do I have to add some contstraints to resolve these apparent boundary problems? If so, how?
Attached is an example .py file with example XYZ .csv files.
Thanks
Solved! Go to Solution.