Hatch Fill
 1-20  21-37

Next
 From:  scott (SSHWARTS)
7279.1 
Does anyone have a script (or start of a script) that would hatch fill a closed curve with lines? (bonus points for a cross hatch option).
What I need it for is that when I engrave bricks (yes, bricks) on my laser cutter, I actually have to use cut vs engrave so to fill the item in (vs just an outline) I have to cut little lines to give the effect.

Thanks,
Scott
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.2 In reply to 7279.1 
Hi Scott, here's a quick start:

Copy the file hatchit.js in the commands folder
Restart Moi
Draw a closed shape
Select it
TAB
hatchit
ENTER



The first line var hatchlineOffset = 1; determines the hatch density

Image Attachments:
Size: 85 KB, Downloaded: 73 times, Dimensions: 641x618px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.3 In reply to 7279.2 
A quick cross hatch version:
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7279.4 In reply to 7279.1 
There is an older post about this. Existing Moi commands can do the work...

There are "algorithms" for it, and a couple of papers. I tried doing a script many months ago, with scanlines, so the
borders would alternate, but got bogged down with KD trees, etc. :-)

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.5 In reply to 7279.2 
Applied to solids:



  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  scott (SSHWARTS)
7279.6 
That's superb thank you!
I tried to find a previous thread about this but couldn't.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mindset (IGNITER)
7279.7 
Maybe the "Dashed curve" script could be applied somehow to HatchIt.js ?
http://moi3d.com/forum/index.php?webtag=MOI&msg=6518.14
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7279.8 In reply to 7279.6 
This discussion was a bit different from "hatch," and was for water jet etching.
http://moi3d.com/forum/index.php?webtag=MOI&msg=6218.1

- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.9 In reply to 7279.2 
I updated the HatchIt script.
You can now enter the hatch line spacing and choose a cross hatch option.

NOTE
The closed shapes must be drawn in the top view.
If you want to hatch several closed curves at once they must be all on the same Z plane.

HINT
You can hide all hatch lines In the Scene browser under Objects.
Or you can select and delete or color all hatch lines.

EDITED: 4 Dec 2017 by MARTIN3D

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.10 In reply to 7279.9 
I updated the script in the previous post with a live preview of the hatch lines.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  danperk (SBEECH)
7279.11 
Thanks Martin! :)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.12 In reply to 7279.9 
I updated the script in post 7279.9 again
http://moi3d.com/forum/index.php?webtag=MOI&msg=7279.9

Now you see a live preview of the final result and you can also choose the hatch direction.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BEAR17
7279.13 
French version of the Hatch Fill is done ! :)



  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
7279.14 In reply to 7279.13 
Cool!

Un de moins! :)

et voilĂ ! ;)
http://moiscript.weebly.com/hachures.html

EDITED: 26 Feb 2016 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  BEAR17
7279.15 
Pilou, c'est une modeste contribution au regard de ton investissement personnel !
Pilou, it's not to much against what you have done for Moi3D !
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Marbleman
7279.16 
Is this a bridge to far or is it possible to create other Hatch Fills as attached jpg......would be very handy!

James Elliott
www.jameselliott.co.uk
Image Attachments:
Size: 635 KB, Downloaded: 88 times, Dimensions: 1117x1074px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7279.17 In reply to 7279.16 
Hi James,

> Is this a bridge to far or is it possible to create other Hatch Fills as attached jpg

I guess it's possible, but would probably require quite a bit of work.

Someday I would like to have hatching and drafting type stuff set up directly in MoI but it will still be a while yet before I'll be able to focus on that.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Martin (MARTIN3D)
7279.18 
Hi Michael,
I noticed that when I use my Hatchit script with V4 beta Nov-18-2017 the two check boxes are not showing.

code:
<html>
	<head>
	</head>
	
	<body class="commandbody">
	
	<div id="TitleContainer" style="width:100%; text-align:center;"> 
		<strong>Hatch selected objects</strong>
	</div>
	
	<div id="InputContainer" class="commandoptions" style="width:100%; padding-top:0.75em; padding-left:0.85em;">
		Line spacing
		<br>
		<moi:DistanceInput id="offset" value="2">  
		<br>
		<br>
		<moi:CheckButton id="left_right" default="true">Left to right</moi:CheckButton>
		<br>
		<moi:CheckButton id="right_left" default="false">Right to left</moi:CheckButton>
		<br>
	</div>
		
		<moi:CommandDoneCancel />
	</body>
</html>
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7279.19 In reply to 7279.18 
Hi Martin, it's because your <moi:DistanceInput> control is not closed. V3 and V4 differ on how malformed HTML is processed, V3 would scan ahead and see there is no end tag found and then close off the tag. V4 I believe adheres to what is supposed to happen which is that it puts the content after your unclosed tag as children of it and doesn't close it off automatically at its origin point.

You can fix it and make it work in both V3 and V4 by closing that tag like this:

code:
<moi:DistanceInput id="offset" value="2"/> 


- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
7279.20 In reply to 7279.19 
Lines 60 and 61 of .js are missing semicolons.
Runs on MoI4beta11_28_17 in top view, after making the 3 changes: / ; and ;
- Brian

As a general question, is there some kind of 3rd party debugger or interpreter checker program?
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-37