LISP FOR JOINING TWO SEPERATE TRIANGLES

LISP FOR JOINING TWO SEPERATE TRIANGLES

sri.ravi36
Participant Participant
415 Views
8 Replies
Message 1 of 9

LISP FOR JOINING TWO SEPERATE TRIANGLES

sri.ravi36
Participant
Participant

Is there any LISP that can join two seperate triangles by clicking on the faces of those triangles. It will be helpfull for me while combining FMB. Align command can do the work perfectly but it takes lot of time while the FMB is larger with so many triangles. Please help me with this issue. Thanks in advance.

0 Likes
416 Views
8 Replies
Replies (8)
Message 2 of 9

Kent1Cooper
Consultant
Consultant

What is FMB?  [I didn't notice anything that looked likely on some acronym listing websites.]

 

An illustration or sample drawing file indicating before and after conditions would help.

Kent Cooper, AIA
0 Likes
Message 3 of 9

komondormrex
Mentor
Mentor
0 Likes
Message 4 of 9

Kent1Cooper
Consultant
Consultant

Is the idea that triangles generated out of FMB content do not meet correctly along their edges, and something is needed to make them do so?  If that's the case, I wouldn't have much trust in the FMB contents to begin with.  If I misunderstand, my request for an example stands.

Is the 3rd dimension involved?  If two triangles don't meet, how is the one that stays vs. the one that is changed determined?  Should triangles remain in their shape but be moved, or should the shape change to meet another [i.e. leave the corner that is not at an end of the meeting edge where it is]?  Does the scaling option in ALIGN apply?  Presumably fixing the relationship between one pair of triangles impacts their relationship to others?  Etc., etc.

Kent Cooper, AIA
0 Likes
Message 5 of 9

sri.ravi36
Participant
Participant

Im attaching a FMB image. 375_page-0001.jpg

0 Likes
Message 6 of 9

sri.ravi36
Participant
Participant

Im making it simple now. Is there any LISP which will merge two triangles over faces. For reference a image file has been attached.SAMPLE_page-0001.jpg

0 Likes
Message 7 of 9

Kent1Cooper
Consultant
Consultant

Since those are identical triangles, and could be aligned along any of their equal-length edges, what would determine which of the three sides is used?

 

And are they always closed Polylines [never made up of three Lines, never Blocks]?

 

What if two triangles are selected that don't have any sides of the same length?

 

My earlier question about which stays and which moves is still unanswered.  The first one selected stays, perhaps?  That would mean it must be done by two individual selections, never by a window.

Kent Cooper, AIA
0 Likes
Message 8 of 9

marko_ribar
Advisor
Advisor

Study complete topic :

https://www.theswamp.org/index.php?topic=44783.0 

 

HTH.

M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 9 of 9

komondormrex
Mentor
Mentor

hey,

straight rude, yet effective code to align line-segmented plines. target->source. aligning point is determined as closest to the nearest vertex from picked point for both plines.

 

 

 

;*******************************************************************************************************************************************************************

 (vl-load-com)

;*******************************************************************************************************************************************************************

	(defun round_ (float_number up / )
		(setq whole_number (fix float_number))
		(if up
			(1+ whole_number)
			whole_number
		)
	)

;*******************************************************************************************************************************************************************

(defun c:align_to (/ target_pline_data source_pline_data target_picked_point target_picked_point_parameter target_picked_point_previous_parameter
					 target_picked_point_previous_parameter_point target_picked_point_next_parameter target_picked_point_next_parameter_point
					 source_picked_point source_picked_point_parameter source_picked_point_previous_parameter source_picked_point_previous_parameter_point
					 source_picked_point_next_parameter source_picked_point_next_parameter_point
					 target_align_point_parameter target_align_point target_align_angle
					 source_align_point_parameter source_align_point source_align_angle
					 target_rotate_angle
				  )
	(setq target_pline_data (entsel "\nSelect edge of target triangle: ")
	  	  source_pline_data (entsel "\nSelect edge of source triangle: ")
	  	  target_picked_point (vlax-curve-getclosestpointto (setq target_pline_object (vlax-ename->vla-object (car target_pline_data)))
	  		                 							  	(cadr target_pline_data)
	  		         		  )
	  	  target_picked_point_parameter (vlax-curve-getparamatpoint target_pline_object target_picked_point)
	  	  target_picked_point_previous_parameter (round_ target_picked_point_parameter nil)
	  	  target_picked_point_previous_parameter_point (vlax-curve-getpointatparam target_pline_object target_picked_point_previous_parameter)
	  	  target_picked_point_next_parameter (round_ target_picked_point_parameter t)
	  	  target_picked_point_next_parameter_point (vlax-curve-getpointatparam target_pline_object target_picked_point_next_parameter)
	  	  source_picked_point (vlax-curve-getclosestpointto (setq source_pline_object (vlax-ename->vla-object (car source_pline_data)))
	  		                 							  	(cadr source_pline_data)
	  		         		  )
	  	  source_picked_point_parameter (vlax-curve-getparamatpoint source_pline_object source_picked_point)
	  	  source_picked_point_previous_parameter (round_ source_picked_point_parameter nil)
	  	  source_picked_point_previous_parameter_point (vlax-curve-getpointatparam source_pline_object source_picked_point_previous_parameter)
	  	  source_picked_point_next_parameter (round_ source_picked_point_parameter t)
	  	  source_picked_point_next_parameter_point (vlax-curve-getpointatparam source_pline_object source_picked_point_next_parameter)
	)
  	(if (< (distance target_picked_point target_picked_point_next_parameter_point)
		   (distance target_picked_point target_picked_point_previous_parameter_point)
		)
  			(setq target_align_point_parameter target_picked_point_next_parameter
				  target_align_point target_picked_point_next_parameter_point
				  target_align_angle (angle target_align_point target_picked_point_previous_parameter_point)
			)
  			(setq target_align_point_parameter target_picked_point_previous_parameter
				  target_align_point target_picked_point_previous_parameter_point
				  target_align_angle (angle target_align_point target_picked_point_next_parameter_point)
			)
  	)
  	(if (< (distance source_picked_point source_picked_point_next_parameter_point)
		   (distance source_picked_point source_picked_point_previous_parameter_point)
		)
  			(setq source_align_point_parameter source_picked_point_next_parameter
				  source_align_point source_picked_point_next_parameter_point
				  source_align_angle (angle source_align_point source_picked_point_previous_parameter_point)
			)
  			(setq source_align_point_parameter source_picked_point_previous_parameter
				  source_align_point source_picked_point_previous_parameter_point
				  source_align_angle (angle source_align_point source_picked_point_next_parameter_point)
			)
  	)
	(setq target_rotate_angle (- source_align_angle target_align_angle))
	(vla-rotate target_pline_object (vlax-3d-point target_align_point) target_rotate_angle)
	(vla-move target_pline_object (vlax-3d-point target_align_point) (vlax-3d-point source_align_point))
	(vlax-release-object target_pline_object)
	(vlax-release-object source_pline_object)
	(princ)
)

;*******************************************************************************************************************************************************************

 

0 Likes