Jump to content
Developer Wiki and Function Reference Links ×

Check-routine for 2D/3D geometry


Recommended Posts

Hi,

 

i never made a Marionette before, but i would like to learn it

and i have an idea for my first project.

 

Often it have to import a lot of 2D or 3D objects into my drawings.

 

I want to check, if my objects (mostly 2D polygons) have perfect 90° angles

or if other objects like 2D lines are drawn horizontally (0°) or vertically (90°) perfect to the actual axis.

 

I'm also a Sketchup (SKP) user. In SKP i have a option to temporary show me the objects with the

colors of the axis, if they align perfect with the axis direction.

 

Lines perfect to x-axis are temporary shown in red

Lines perfect to y-axis are temporary shown in green

Lines perfect to z-axis are temporary shown in blue

Other Lines are got a black color.

 

I often use this to check my geometry, i find this a very very useful feature in SKP 

 

Can i solve such a checking routine, with a Marionette?

 

/ / / 

 

Three projects i have in mind:

 

1.0 Check the selected objects (2D or 3D), if the edges are perfect aligned to the actual axis. if so, draw 2D or 3D lines on the same position

      on a new layer with the line-color of the  axis, if not, draw 2D or 3D lines on the same position on a new layer with black color.

 

2.0 Check polygons if they have perfect 90° angles and group all polygons which not have 90° angles.

 

3.0  Convert all polygons with 4 endpoints and perfect 90° angles to rectangles.

 

Greetings from Germany

… any many thnx for helping me out.

Tobi

Link to comment
  • 1 month later...

Hello,

 

i tried to make the 2D part of your project 1.0.

I think doing this only with marionette (without custom nodes) is not easy (maybe even impossible). I tried to make a marionette for one 2D polygon and it works fine, but if i want to be able to process multiple 2D polygons at once i come to a point where i would need to write my own nodes. But instead of writing my own nodes i would rather write the whole script in python.

 

However there are workarounds for the 2D part.

1. Convert your import into lines manually and make a marionette for lines:

The marionette for lines in 2D could look something like this, but i dont recommend doing it this way.

grafik.thumb.png.3b01733e77ce34f5d3c074763021b55f.png

 

 

2. Convert your import into lines manually and make data visualisations:

For 2D lines you can achive something like what you want with data visualisations. Simply make a visualisation for lines with a "Bounding Box delta x" of 0 (line is parallel to y), and one for lines with a "Bounding Box delta y" of 0 (line is parallel to x).

 

 

Regards

Letti

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...