Home
Reply
Regular Contributor
Vi2
Posts: 55

Error in api_convert_to_spline()

In addition to other errors in api_convert_to_spline(), associated with bad generation of pcurves, there is an example with wrong splitting of FACEs during this conversation. Most LOOPs are self-intersected. Again, I don't know what I should ask. :(

 

part0005_32.sat - origin model, part0005_32.splined.sat - splined model, part0005_32.jpg - picture of the problem, part0005_32.scm - Scheme AIDE script.

 

Content of part0005_32.scm, which I could not add to attachments :

 

(define floopexternal (lambda (f) (map loop:external? (entity:loops f))))
(define flooptype (lambda (f) (map loop:type (entity:loops f))))

(define detail (car (part:load "C:/TEMP/part0005_32.sat")))

(map face:spline? (entity:faces detail))       ;-> (#f)
(map floopexternal (entity:faces detail))      ;-> ((#t #t #f))
(map flooptype (entity:faces detail))           ;-> (("Separation loop (U)" "Separation loop (U)" "Hole"))

(option:get "split_periodic_splines")           ;-> #t
(option:set "new_periodic_splitting" 3)       ;-> #f
(define sdetail (entity:spline-convert detail))

(map face:spline? (entity:faces sdetail))     ;-> (#t #t #t #t #t)
(map floopexternal (entity:faces sdetail))    ;-> ((#t) (#f #f) (#t) (#t) (#t))
(map flooptype (entity:faces sdetail))         ;-> (("Periphery loop") ("Hole" "Hole") ("Separation loop (U)") ("Periphery loop") ("Periphery loop"))


(entity:delete detail)
(option:set "sequence_save_files" #t)
(part:save "C:/TEMP/part0005_32.splined.sat")

 

BTW, with new_periodic_splitting = 2 this example has been splitted accurately.

 

(define detail (car (part:load "C:/TEMP/part0005_32.sat")))
(option:get "split_periodic_splines")
(option:set "new_periodic_splitting" 2)
(define sdetail (entity:spline-convert detail))
(map face:spline? (entity:faces sdetail))      ;-> (#t)
(map floopexternal (entity:faces sdetail))     ;-> ((#t #f))
(map flooptype (entity:faces sdetail))          ;-> (("Periphery loop" "Hole"))

Spatial Employee
Brian
Posts: 20

Re: Error in api_convert_to_spline()

Hi - If you check the part in part0005_32.sat (map entity:check (part:entities)), you'll find tons of "tolerize needed" errors: internal position of coedge off face, edge end param err; etc. To fix these errors, you must tolerize the part; in scheme, use: (map entity:tolerize (part:entities)). After that, the spline convert will work with new_periodic_splitting==3. I would recommend using new_periodic_splitting==3, because it avoids making sliver faces and minimizes spline conversion topology changes.

Cheers,

Brian

Regular Contributor
Vi2
Posts: 55

Re: Error in api_convert_to_spline()

Thanks, Brian!

 

We are using api_hh_XXXX functions to heal such questionable model.

 

Also I add "(map entity:tolerize (part:entities))" to my toolbox. Thanks again.

 

Vita.